php text doesnt appearing correctly - php

Actually I don't know how to search this issue, if it is css or php issue.
I have a div that opens a hidden div.
When I test the code outside the website it works fine. When I tested inside the website I took this.
see the picture here (http://grab.by/H8TW)
The full construct of the code is:
<ol>
<div><div>
<div></div>
<div>
<li>
<div class="lyrics">
<article>
<input type="checkbox" id="read_more" role="button">
<label for="read_more" onclick=""><span>Lyrics</span><span>Hide Lyrics</span></label>
<section></section>
<section><?php $lyric = get_post_meta(get_the_ID(), '_lyrics', true); echo $lyric; ?>
</section>
</article>​
</div>
</div>
</li>
</ol>
CSS
div.lyrics {
position: relative;
top: 10px;
}
article {
margin-bottom: 3rem;
position: relative;
*zoom: 1;
}
article:before, article:after {
content: "";
display: block;
}
article:after { clear: both }
article figure {
float: right;
width: 32.5%;
}
article section:first-of-type {
float: left;
width: 62.5%;
}
article section:last-of-type {
display: none;
visibility: hidden;
}
section {
-webkit-transition: .125s linear;
-moz-transition: .125s linear;
-ms-transition: .125s linear;
-o-transition: .125s linear;
transition: .125s linear;
}
input[type=checkbox] {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
width: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
}
[for="read_more"] {
position: absolute;
bottom: -3rem;
left: 0;
width: 100%;
text-align: center;
padding: .65rem;
box-shadow: inset 1px 1px rgba(0, 0, 0, 0.1), inset -1px -1px rgba(0, 0, 0, 0.1);
}
[for="read_more"]:hover {
background: rgba(0,0,0,.5);
color: rgb(255,255,255);
}
[for="read_more"] span:last-of-type {
display: none;
visibility: hidden;
}
input[type=checkbox]:checked ~ section {
display: block;
visibility: visible;
width: 100%;
}
input[type=checkbox]:checked ~ figure { width: 100% }
input[type=checkbox]:checked ~ [for="read_more"] span:first-of-type {
display: none;
visibility: hidden;
}
input[type=checkbox]:checked ~ [for="read_more"] span:last-of-type {
display: block;
visibility: visible;
}
Thanks for any help!

The solution of the problem came from the text editor, where I use enter for each break (< br >) I wanted to have! So every text line was a paragraph (< p >).

Related

How to display button in tooltip

I have a tooltip in my project.
What I like to do is add active button to my tooltip.
Problem is that the tooltip is displaying a HTML tags not a button...
Here is the effect of my work:-)
enter image description here
Bellow is my code.
Please if some one can help. Thank You.
/* Frame */
.frame {
height: 150px;
max-width: 1170px;
/*line-height: 130px;*/
/* overflow:visible !important;*/
}
.frame ul {
list-style: none;
margin: 0;
padding: 0;
height: 100%;
font-size: 14px;
}
.frame ul li {
float: left;
width: 232px;
height: 100%;
margin: 0 2px 0 0;
padding: 0;
background: #f1f1f1;
color: #00b5f6;
text-align: center;
cursor: default;
display:flex;
}
.frame ul li:hover{
color: #fff;
background: #00b5f6;
}
/* setup tooltips */
.tooltip {
position: relative;
z-index:1;
}
li .tooltip{
overflow:visible;
}
.tooltip:before,
.tooltip:after {
position:absolute;
display:inline-block;
opacity: 0;
pointer-events: none;
width:225px;
}
.tooltip:after {
border-right: 6px solid transparent;
border-top: 6px solid #00b5f6;
border-left: 6px solid transparent;
content: '';
height: 0;
top: -5px;
left: 20px;
width: 0;
display:none;
}
.tooltip:before {
background: #00b5f6;
border-radius: 2px;
color: #fff;
content: attr(data-title);
font-size: 12px;
padding: 6px 10px;
top: 0px;
left: 0px;
white-space: nowrap;
height:118px;
max-width:212px !important;
display:block;
word-wrap: break-word;
text-align: left;
white-space: pre-line;
}
/* expand */
.tooltip.expand:before {
transform: scale3d(.2,.2,1);
transition: all .2s ease-in-out 0.5s;
}
.tooltip.expand:after {
transform: translate3d(0,6px,0);
transition: all .2s ease-in-out 0.5s;
}
.tooltip.expand:hover:before,
.tooltip.expand:hover:after {
opacity: 1;
transform: scale3d(1,1,1);
}
.date_event{
text-align:left; width:232px; position:absolute; padding: 5px 0 0 5px; font-style: italic; max-height:20px; z-index:-1;
}
.suwak{
width:232px; height:150px; margin-left:auto; margin-right:auto; overflow-y:visible; overflow-x:hidden; border:solid 1px #000;
}
.title_event{
font-size:16px; font-weight:bold; width:232px; height:130px; vertical-align: middle !important; display: table-cell !important; margin-left:auto; margin-right:auto;
}
<?php $tooltip = "Lorem ipsum dolor sit amet enim.";
$tooltip = $tooltip."<div class='btn_google'>google</div>"; ?>
<div class="suwak">
<div class="frame" id="basic">
<li class="tooltip expand" data-title="<?php echo $tooltip;?>">
<div class="date_event">02.02.2017</div>
<div style="text-align: center; width:232px;">
<div class="title_event">Some title</div>
</div>
</li>
</div>
</div>
That li is not need, just change it to div
Also why not just add a hidden div block as tooltip container, on hover show it (just like the tooltip):
.expand:hover>div {
display: none;
height: 148px;
width: 232px;
}
.mytitle {
display: none;
}
.expand:hover>.mytitle {
display: block;
background: red;
}
/* Frame */
.frame {
height: 150px;
max-width: 1170px;
/*line-height: 130px;*/
/* overflow:visible !important;*/
}
.frame ul {
list-style: none;
margin: 0;
padding: 0;
height: 100%;
font-size: 14px;
}
.frame ul li {
float: left;
width: 232px;
height: 100%;
margin: 0 2px 0 0;
padding: 0;
background: #f1f1f1;
color: #00b5f6;
text-align: center;
cursor: default;
display: flex;
}
.frame ul li:hover {
color: #fff;
background: #00b5f6;
}
/* setup tooltips */
.tooltip {
position: relative;
z-index: 1;
}
li .tooltip {
overflow: visible;
}
.tooltip:before,
.tooltip:after {
position: absolute;
display: inline-block;
opacity: 0;
pointer-events: none;
width: 225px;
}
.tooltip:after {
border-right: 6px solid transparent;
border-top: 6px solid #00b5f6;
border-left: 6px solid transparent;
content: '';
height: 0;
top: -5px;
left: 20px;
width: 0;
display: none;
}
.tooltip:before {
background: #00b5f6;
border-radius: 2px;
color: #fff;
content: attr(data-title);
font-size: 12px;
padding: 6px 10px;
top: 0px;
left: 0px;
white-space: nowrap;
height: 118px;
max-width: 212px !important;
display: block;
word-wrap: break-word;
text-align: left;
white-space: pre-line;
}
/* expand */
.tooltip.expand:before {
transform: scale3d(.2, .2, 1);
transition: all .2s ease-in-out 0.5s;
}
.tooltip.expand:after {
transform: translate3d(0, 6px, 0);
transition: all .2s ease-in-out 0.5s;
}
.tooltip.expand:hover:before,
.tooltip.expand:hover:after {
opacity: 1;
transform: scale3d(1, 1, 1);
}
.date_event {
text-align: left;
width: 232px;
position: absolute;
padding: 5px 0 0 5px;
font-style: italic;
max-height: 20px;
z-index: -1;
}
.suwak {
width: 232px;
height: 150px;
margin-left: auto;
margin-right: auto;
overflow-y: visible;
overflow-x: hidden;
border: solid 1px #000;
}
.title_event {
font-size: 16px;
font-weight: bold;
width: 232px;
height: 130px;
vertical-align: middle !important;
display: table-cell !important;
margin-left: auto;
margin-right: auto;
}
.expand:hover>div {
display: none;
}
.mytitle {
height: 0px;
width: 0px;
display: none;
}
.expand:hover>.mytitle {
height: 150px;
width: 232px;
display: block;
background: red;
}
<div class="suwak">
<div class="frame" id="basic">
<div class="expand" data-title="">
<div class="mytitle">my title <button>123</button><button>123</button></div>
<div class="date_event">02.02.2017</div>
<div style="text-align: center; width:232px;">
<div class="title_event">Some title</div>
</div>
</div>
</div>
</div>
You can do this without using Javascript. Remove that li and do something like this in a simple way:
.box{
width: 200px;
height: 100px;
position: relative;
background-color: silver;
text-align: center;
}
.box:hover .tip{
display: block;
}
.tip{
display: none;
background-color: yellow;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
<div class="box">
<div class="tip">
This is tip content and this is <button>button</button> in it
</div>
Box content
</div>
UPDATE
from the link that you provided on your comment (uw.edu.pl) This is what you are trying to do:
ul{
list-style: none;
}
ul.main{
display: inline-block;
margin-top: 50px;
}
ul.main>li{
width: 200px;
height: auto;
position: relative;
background-color: silver;
text-align: center;
}
ul li ul{
display: none;
}
ul li a{
display: block;
height: 100%;
text-decoration: none;
color: white;
}
ul li:hover ul{
display: block;
}
ul.tip{
display: none;
background-color: yellow;
position: absolute;
bottom: 100%;
padding: 0;
height: auto;
left: 0;
right: 0;
z-index: 1;
}
<ul class="main">
<li>
Box content 1
<ul class="tip">
<li>
This is tip content and this is <button>button1</button> in it
</li>
</ul>
</li><li>
Box content 2
<ul class="tip">
<li>
This is tip content and this is <button>button2</button> in it
</li>
</ul>
</li><li>
Box content 3
<ul class="tip">
<li>
This is tip content and this is <button>button3</button> in it
</li>
</ul>
</li><li>
Box content 4
<ul class="tip">
<li>
This is tip content and this is <button>button4</button> in it
</li>
</ul>
</li>
</ul>

How to modify css to "box-shadow" to portrait or landscape image dynamically

I am looking to have the below code to dynamically change the box-shadow to match the image orientation. . . either landscape or portrait. Here is a link to an example: http://gbamedical.com/test3.php It currently looks funny when a portrait image is left orientated with landscape box. Also looking to have thumbnails the same height which would require portrait thumbnails to be narrower.
The CSS:
style>* {
margin: 0;
padding: 0;
}
.slider {
width: 640px;
position: relative;
padding-top: 480px;
margin: 20px auto;
box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.75);
}
.slider > img {
position: absolute;
left: 0;
top: 0;
transition: all 0.5s;
}
.slider input {
display: none;
}
.slider label {
width: 60px;
margin: 20px 2px;
float: left;
border: 2px solid #999;
cursor: pointer;
transition: all 0.5s;
opacity: 0.6;
box-sizing: border-box;
}
.slider label img {
width: 100%;
display: block;
}
.slider input:checked + label {
border-color: #666;
opacity: 1;
}
.slider input ~ img {
opacity: 0;
transform: scale(1.1);
}
.slider input:checked + label + img {
opacity: 1;
transform: scale(1);
}
</style>
The PHP code:
<div class="slider">
<?php
$array = glob('ebayimg/8851gba050516/size_2/*');
$i = 1;
foreach($array as $image) {
?>
<input type="radio" name="slide" id="image<?php echo $i ?>" <?php if($i == 1){ ?> checked <?php } ?>/>
<label for="image<?php echo $i ?>">
<img src="http://www.gbamedical.com/<?php echo $image ?>"/>
</label>
<img src="http://www.gbamedical.com/<?php echo $image ?>" height="480"/>
<?php
$i++;
}
?>
You may have to use javascript to change it on the fly by getting the width of the image and changing the .slider width accordingly:
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
$(document).ready(function(e) {
$("label").on('click',function() {
var preview = $(this).next();
var getW = preview.width();
$(".slider").css({"width":getW*.91});
});
});
</script>
Here is a jsFiddle Demo
EDIT
Try this set of styles:
* {
margin: 0;
padding: 0;
}
.slider {
max-width: 640px;
position: relative;
padding-top: 480px;
margin: 20px auto;
display: block;
text-align: center;
}
.slider > img {
position: absolute;
left: 0;
top: 0;
transition: all 0.5s;
box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.75);
}
.slider input {
display: none;
}
.slider label {
height: 60px;
margin: 20px 2px;
float: left;
border: 2px solid #999;
cursor: pointer;
transition: all 0.5s;
opacity: 0.6;
box-sizing: border-box;
}
.slider label img {
max-height: 60px;
display: block;
}
.slider input:checked + label {
border-color: #666;
opacity: 1;
}
.slider input ~ img {
opacity: 0;
transform: scale(1.1);
}
.slider input:checked + label + img {
opacity: 1;
transform: scale(1);
}
Here is a jsFiddle demo with the css above.

Make Modal not scroll to bottom of page

How would I do it so when my model opens, it doesn't automatically scroll me all the way to the bottom of the page
<style>
body {
color: #333;
height: 80em;
z-index: 1000;
}
.wrap {
padding: 40px;
text-align: center;
}
h1 {
font-size: 30px;
margin-bottom: 40px;
}
p {
margin-bottom: 20px;
}
.btn {
background: #428bca;
border: #357ebd solid 1px;
border-radius: 3px;
color: #fff;
display: inline-block;
font-size: 14px;
padding: 8px 15px;
text-decoration: none;
text-align: center;
min-width: 60px;
position: relative;
transition: color .1s ease;
}
.btn:hover {
background: #357ebd;
}
.btn.btn-big {
font-size: 18px;
padding: 15px 20px;
min-width: 100px;
}
.btn-close {
color: #aaa;
font-size: 30px;
text-decoration: none;
position: absolute;
right: 5px;
top: 0;
}
.btn-close:hover {
color: #919191;
}
.modal:before {
content: "";
display: none;
background: rgba(0, 0, 0, 0.6);
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 10;
}
.modal:target:before {
display: block;
}
.modal:target .modal-dialog {
-webkit-transform: translate(0, 0);
-ms-transform: translate(0, 0);
transform: translate(0, 0);
top: 20%;
}
.modal-dialog {
background: #fefefe;
border: #333 solid 1px;
border-radius: 5px;
margin-left: -200px;
position: fixed;
left: 50%;
top: -100%;
z-index: 11;
width: 360px;
-webkit-transform: translate(0, -500%);
-ms-transform: translate(0, -500%);
transform: translate(0, -500%);
-webkit-transition: -webkit-transform 0.3s ease-out;
-moz-transition: -moz-transform 0.3s ease-out;
-o-transition: -o-transform 0.3s ease-out;
transition: transform 0.3s ease-out;
padding: 8px;
}
.modal-body {
padding: 20px;
}
.modal-header,
.modal-footer {
padding: 10px 20px;
}
.modal-header {
border-bottom: #eee solid 1px;
}
.modal-header h2 {
font-size: 20px;
}
.modal-footer {
border-top: #eee solid 1px;
text-align: right;
}
.thebutton {
display: inline-block;
color: #fff!important;
padding: 6px 12px!important;
border-radius: 5px;
box-shadow: 0 3px 0 1px rgba(0, 0, 0, .3);
line-height: 1;
white-space: nowrap;
text-transform: uppercase;
border-width: 2px;
border-style: solid;
margin-top: 3px;
font-size: 11px;
text-shadow: 0 1px #333;
font-weight: 700;
margin-right: 5px
}
.yes {
background-color: #00813e;
border-color: #8eda55;
float: right
}
.yes:hover {
background-color: #00ab54;
border-color: #b9f373
}
.no {
background-color: #c6165f;
border-color: #f57aad;
float: right
}
.no:hover {
background-color: #d45087;
border-color: #f89dc2
}
#close {
display: none;
}</style>
and also how would I go about aligning the yes and no boxes shown below to the right that say YES and NO without the text affecting them like when I type more text, the box expands
<div class="modal" id="confirm" aria-hidden="true">
<div class="modal-dialog">
<div class="contentHeader headerRed">
<div class="inside">
FOOKIN MODAL BOX M8
</div>
</div>
<img src="https://avatar-retro.com/habbo-imaging/avatarimage?figure=<?php
echo mysql_result(mysql_query("SELECT look FROM users WHERE id = '" . $_SESSION['user']['id'] . "'"), 0);
?>&direction=2&head_direction=3&gesture=sml&action=wav" align="left">
<br>
Hey there <b>{username}</b><br>Are you sure you want to<br> sign out of the hotel??
<br/><div class="thebutton yes">YES</div><br><br><br> <div class="thebutton no">NO</div>
</div>
</div>
For positioning the modal, you are using:
.modal-dialog {
top: -100%;
}
Try adjusting that.
As far as the buttons, remove the <br>'s and then either float the buttons or change their display to inline-block.

Place 3 box in a single row

I am fetching data images from database and wish to place maximum 3 images in a single row and these images also have hover effect on them which is working fine
problem that i am facing is that if i am using this code to display static images then it is working fine but if i fetch the data from database then it is not displaying properly. i want to display images in this form
1st_image 2nd_image 3rd_image
4th_image 5th_image 6th_image
7th_image .. and so on
but i am getting images in this form
1st_image
2nd_image
3rd_image
4th_image
5th_image
6th_image
The code that i have is
code of my front page is
<?php
$sql = "SELECT * FROM category";
$result = mysqli_query($con, $sql);
if (mysqli_num_rows($result) > 0)
{
while($row = mysqli_fetch_assoc($result))
{
$catname=$row["catname"];
$catdesc=$row["catdesc"];
$catpic=$row["catpic"];
$id=$row["id"];
?>
<div id="effect-2" class="effects clearfix">
<div class="img">
<img src="<? echo $catpic; ?>" alt="">
<div class="overlay">
content
<a class="close-overlay hidden">x</a>
</div>
</div>
</div>
<?}
}?>
code on css page is
nav ul {
list-style-type: none;
margin: 0 0 30px 0;
padding: 0;
text-align: center;
}
nav ul li {
display: inline-block;
margin-bottom: 4px;
}
nav ul li a {
display: block;
padding: 5px 20px;
color: #fff;
background-color: #32c896;
}
nav ul li a:hover {
color: #fff;
background-color: #238b68;
}
nav ul li a.active {
color: #fff;
background-color: #238b68;
}
.effects {
padding-left: 15px;
}
.effects .img {
position: relative;
float: left;
margin-bottom: 5px;
width: 25%;
overflow: hidden;
}
.effects .img:nth-child(n) {
margin-right: 5px;
}
.effects .img:first-child {
margin-left: -15px;
}
.effects .img:last-child {
margin-right: 0;
}
.effects .img img {
display: block;
margin: 0;
padding: 0;
max-width: 100%;
height: auto;
}
.overlay {
display: block;
position: absolute;
z-index: 20;
background: rgba(0, 0, 0, 0.8);
overflow: hidden;
-webkit-transition: all 0.5s;
-moz-transition: all 0.5s;
-o-transition: all 0.5s;
transition: all 0.5s;
}
a.close-overlay {
display: block;
position: absolute;
top: 0;
right: 0;
z-index: 100;
width: 45px;
height: 45px;
font-size: 20px;
font-weight: 700;
color: #fff;
line-height: 45px;
text-align: center;
background-color: #000;
cursor: pointer;
}
a.close-overlay.hidden {
display: none;
}
a.expand {
display: block;
position: absolute;
z-index: 100;
width: 60px;
height: 60px;
border: solid 5px #fff;
text-align: center;
color: #fff;
line-height: 50px;
font-weight: 700;
font-size: 30px;
-webkit-border-radius: 30px;
-moz-border-radius: 30px;
-ms-border-radius: 30px;
-o-border-radius: 30px;
border-radius: 30px;
}
#effect-2 .overlay {
top: 0;
left: 0;
right: 0;
width: 100%;
height: 0;
}
#effect-2 .overlay a.expand {
left: 0;
right: 0;
top: 50%;
margin: -30px auto 0 auto;
}
#effect-2 .img.hover .overlay {
height: 100%;
}
can anyone tell me how to do so
You should use unique ids in your html. I recommend to always use classes instead of id. You can do something like this in your CSS
div[id^="tocolor-"] {
/* some css rules */
}
div[id^="tocolor-"] .overlay {
/* some css rules */
}
And in your html you can add an id using database table id like this
<div id="effect-<?php echo $id; ?>" class="effects clearfix">
Why not use bootstrap and use col-xs-4 class...which will make sure you always have 3 columns
<div id="effect-2" class="col-xs-4">
<div class="img">
<img src="<? echo $catpic; ?>" alt="">
<div class="overlay"> content
<a class="close-overlay hidden">x</a>
</div>
</div>
</div>

how do i allign my div containers using css

how can i align my containers horizontally inside another container. also i want to center align them when the window is resized because every time i try it the containers just keep on popping somewhere i don't want them to please help me thank you. below is the code:
my index page
<html>
<head>
<title> Kwiktable </title>
<link rel="stylesheet" type="text/css" href="jssor.css">
</head>
<body>
<div class="headercontainer" style="z-index:1000;">
<div class="header clearfix"> <span class="logo"><img src="img/kwiktable.png">&nbsp <img src = "img/kwik.png"> </span>
<input type="text" class="textbox" style="color:#888;"
value="Search" onfocus="inputFocus(this)" onblur="inputBlur(this)">
<script>
=function inputFocus(i){
if(i.value==i.defaultValue){ i.value=""; i.style.color="#000"; }
}
function inputBlur(i){
if(i.value==""){ i.value=i.defaultValue; i.style.color="#888"; }
}
</script>
<div class="nav">
<input type="checkbox" id="toggle">
<label for="toggle" class="toggle" onclick=""></label>
<ul class="menu">
<li><a class="current" href="index.php">Home</a></li>
<li>About Us</li>
<li>Reservations</li>
<li>Log in </li>
</ul>
</div>
</div>
</div>
<center>
<br> <br> <br> <br>
<div style="margin:0 auto;width:100%;max-width:1050px;background-color:#E8E8E8;overflow:hidden; border: 1px solid #000000;">
<div class="container" style=" margin-left: 10px; width 100%; max-width: 450px; background-color:#E8E8E8;overflow:hidden;">
<?php include 'content1.html';?>
<?php include 'content.html'; ?>
</div>
<div class="container1" style="margin-right: 10px; margin-top: 10px; width 100%; max-width: 450px; background-color:#E8E8E8;overflow:hidden; "> </div>
<div class="container2">
<?php
echo "<br><h1>Kwiktable's Best</h1>";
include 'best.php';
?>
<br> <br> <br> <br>
</div>
</center>
<?php include 'footer.php'; ?>
</body>
</html>
my css file:
* {
margin: 0;
padding: 0;
outline: 0;
}
html, body {
height: 100%;
background: #fff;
}
body, a {
font: normal 16px Helvetica, Verdana, Geneva, sans-serif;
color: #3f3f3f
}
.textbox {
margin-top: 25px;
width: 500px;
height: 30px;
background-color: #FFEAEA;
border: solid 1px #646464;
border-radius: 5px;
outline: none;
padding: 2px 2px;
}
.textbox:hover {
background-color: #F7C4C4;
-webkit-transition: all .25s linear;
-moz-transition: all .25s linear;
-o-transition: all .25s linear;
transition: all .25s linear
}
.textbox:focus {
box-shadow: 0 0 5px rgba(0, 0, 0, 0.83);
-webkit-transition: all .25s linear;
-moz-transition: all .25s linear;
-o-transition: all .25s linear;
transition: all .25s linear
}
iframe {
margin-top: 15px;
margin-right: 15px;
margin-left: 15px;
margin-bottom: 15px;
border-radius: 10px;
border: solid 1px #000;
}
.headercontainer {
opacity: 0.95;
display: block;
margin: 0 auto;
margin: 0 auto;
background-image: url(img/menubar.jpg);
background-color: #D93625;
z-index: 1000;
position: fixed;
width: 100%;
top: 0;
left: 0;
border-bottom: 1px solid #000;
box-shadow: 0px 1px 1px #888888;
}
.headercontainer:after {
content: '';
display: block;
clear: both
}
.footer {
bottom: 0;
margin: 0 auto;
height: 60px;
padding: 0 0;
background: #bbbfbf;
font-size: 12px;
width: 100%;
border-top: 1px solid #51c1f1
}
#media only screen and (max-width:480px) {
.copyright { display: none }
}
body {
-webkit-animation: bugfix infinite 1s;
-webkit-font-smoothing: antialiased
}
#-webkit-keyframes
bugfix { from {
padding:0;
}
to { padding: 0; }
}
.header {
position: relative;
top: 0;
left: 0;
margin: 0 auto;
}
#toggle, .toggle { display: none }
.menu>li {
list-style: none;
float: left
}
.clearfix:before, .clearfix:after {
display: table;
content: ""
}
.clearfix:after { clear: both }
#media only screen and (max-width:768px) {
.textbox {
width: auto;
-webkit-transition: all .2s linear;
-moz-transition: all .2s linear;
-o-transition: all .2s linear;
transition: all .2s linear;
}
.menu {
display: none;
opacity: 0;
width: 100%;
position: absolute;
right: 0
}
.menu>li {
display: block;
width: 100%;
margin: 0
}
.menu>li>a {
display: block;
width: 100%;
text-decoration: none;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box
}
.toggle {
display: block;
position: relative;
cursor: pointer;
-webkit-touch-callout: none;
-webkit-user-select: none;
user-select: none;
margin-top: 8px
}
#toggle:checked~.menu {
display: block;
opacity: 1
}
}
.header {
min-height: 80px;
max-width: 1500px;
height: 100%;
padding: 0 20px;
background: #D93625;
color: #fff;
}
.header>.logo {
float: left;
padding: 10px 50px;
font-style: italic;
font-size: 28px;
line-height: 50px
}
.nav {
display: block;
float: right;
text-align: right
}
.nav, .menu, .menu>li, .menu>li>a { height: 100% }
.menu>li>a {
display: block;
padding: 20px 17px;
text-decoration: none;
font-weight: normal;
font-size: 16px;
line-height: 2.8;
color: #fff;
border-radius: 10px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
-webkit-transition: all .25s linear;
-moz-transition: all .25s linear;
-o-transition: all .25s linear;
transition: all .25s linear
}
.menu>li>a:hover, .menu>li>a:focus {
background: #8B0000;
border-radius: 10px;
color: #fff;
background-color: #8B0000;
box-shadow: 1px 1px 1px 1px #3D0000 inset;
border-bottom: solid 1px #FF9292;
text-shadow: 0px 0px 10px #E6FF00;
}
.menu>li>a.current {
color: #fff;
font-weight: 900
}
.toggle { z-index: 2 }
#media only screen and (max-width:820px) {
.textbox {
width: auto;
-webkit-transition: all .2s linear;
-moz-transition: all .2s linear;
-o-transition: all .2s linear;
transition: all .2s linear;
}
.menu {
background: #363636;
border-top: 1px solid #fff;
}
.menu, .menu>li, .menu>li>a { height: auto }
.menu>li>a {
padding: 15px 15px;
text-align: center;
background-color: #363636;
border-bottom: 1px solid #fff;
}
.menu>li>a:hover, .menu>li>a:focus {
background: #D70000;
padding: 15px 15px 15px 25px;
}
.toggle:after {
content: 'Menu';
box-shadow: 0px 0px 5px 0px #3D0000 inset;
text-shadow: 0px 0px 10px #E6FF00;
display: block;
width: 80px;
margin: 0 0;
margin-top: 25px;
padding: 10px 0;
background: #D70000;
-webkit-border-radius: 2px;
border-radius: 2px;
text-align: center;
font-size: 12px;
color: #fff;
-webkit-transition: all .5s linear;
-moz-transition: all .5s linear;
-o-transition: all .5s linear;
transition: all .5s linear;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box
}
.toggle:hover:after { background: #920000 }
h1 {
margin: auto;
width: 70%;
}
.container {
width: 700px;
margin-left: auto;
margin-right: auto;
}
.container1 {
margin-left: auto;
margin-right: auto;
width: 100%;
}
#toggle:checked+.toggle:after { content: 'Close' }
}
.share-icon {
display: inline-block;
float: left;
margin: 4px;
width: 32px;
height: 32px;
cursor: pointer;
vertical-align: middle;
background-image: url(img/share/share-icons.png)
}
Looks like you're missing a closing </div> tag which is more than likely why it's jumping all over the page. Use a tool like this to help you: http://www.freeformatter.com/html-validator.html
Nice going with the responsive design, but you may want t focus more on your HTML and CSS.
<center> tags are a bad hack. You should be doing that with CSS. Additionally, your use of <br>s for spacing should also be done with CSS. Take a look into padding and margin.
If you wanted to <center> a div, the css alternative is something like this:
<div class="container">
<div style="margin:0 auto; width: 800px;">This will be centered </div>
</div>
Just to start you out.
What happens here is the container div fills 100% as a standard div should. The child div (the one with the style tag) sets its top and bottom margin to 0, and its left and right margin to auto. The important part here is that the div also has a fixed width. So the div will take up 800px in this instance an any remaining space will automatically be distributed evenly by the margin.
You could Google this and get a better explanation I'm sure.

Categories