Active menu class - php

I created the menu in my website like this. and I want to add active class to current page menu-item.
My menu codes:
<div class="menu-stili" role="main">
<div id="menu-stili_bir">
<?php
$menular = Yii::app()->db->createCommand()
->select('m.idmenu, m.menuparent_id, m.url, m.title_'.Yii::app()->language)
->from ('menu m')
->where('m.menuparent_id=0 and m.active="1"')
->order('m.idmenu asc')->queryAll();
echo "<ul class='menu' >";
foreach($menular as $menu){
if($menu['url'] == '#')
$echoUrl = 'javascript:void(0);';
else
$echoUrl = $baseUrl.'/'.Yii::app()->language.$menu["url"];
echo "<li>";
echo "<a class='menu-li-a' href='".$echoUrl."' title='".$menu['title_'.Yii::app()->language]."'><strong>".$menu['title_'.Yii::app()->language]."</strong><span></span></a>";
}
echo "</ul>";
?>
</div>
</div>
script
<script>
$(document).ready(function() {
$('.menu li a').on('click', function () {
$('a', this).removeClass('menu-li-a').addClass('aktiv-menu');
});
});
</script>
style.css
.menu-stili {
background: rgb(44,83,158);
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzJjNTM5ZSIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMyYzUzOWUiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background: -moz-linear-gradient(top, rgb(44,83,158) 0%, rgb(44,83,158) 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgb(44,83,158)), color-stop(100%,rgb(44,83,158)));
background: -webkit-linear-gradient(top, rgb(44,83,158) 0%,rgb(44,83,158) 100%);
background: -o-linear-gradient(top, rgb(44,83,158) 0%,rgb(44,83,158) 100%);
background: -ms-linear-gradient(top, rgb(44,83,158) 0%,rgb(44,83,158) 100%);
background: linear-gradient(to bottom, rgb(44,83,158) 0%,rgb(44,83,158) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#2c539e', endColorstr='#2c539e',GradientType=0 );
padding: 10px;
display: block;
position: absolute;
min-width: 850px;
width: 98.5%;
z-index: 2;
}
#menu-stili-bir {
margin: 0 auto;
}
.menu {
padding-top: 7px;
margin-left: 6%;
}
.menu li {
float: left;
position:relative;
list-style: none;
}
.menu-li-a {
display:inline-block;
font-size:15px;
font-family: "Segoe UI", Arial, Helvetica, sans-serif;
line-height:1.2em;
padding-bottom:10px;
color: #cedce7;
-webkit-transition: color 1s ease;
-moz-transition: color 1s ease;
-ms-transition: color 1s ease;
-o-transition: color 1s ease;
transition: color 1s ease;
position:relative;
overflow:hidden;
}
.aktiv-menu {
display:inline-block;
font-size:15px;
font-family: "Segoe UI", Arial, Helvetica, sans-serif;
line-height:1.2em;
padding-bottom:10px;
position:relative;
overflow:hidden;
color: #ffffff;
}
.menu li a:hover{
color: #ffffff;
-webkit-transition: color 1s ease;
-moz-transition: color 1s ease;
-ms-transition: color 1s ease;
-o-transition: color 1s ease;
transition: color 1s ease;
}
.menu li strong {
display:inline-block;
padding:0 15px;
font-weight: normal;
}
.menu li span {
display: block;
height: 1.5px;
background-color: white;
position: absolute;
bottom: 0;
}
The items comes from database. So I the CMenu did bot help me. I don't know the missing codes... Please help to solve problem.
Thanks.

Your Javascript wont work because the page will be redirected to another page, you better handle adding the class in your PHP code:
$current_url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
foreach($menular as $menu){
if($menu['url'] == '#')
$echoUrl = 'javascript:void(0);';
else
$echoUrl = $baseUrl.'/'.Yii::app()->language.$menu["url"];
if($menu['url'] == $current_url)
$active_class='active';
else
$active_class='';
echo "<li>";
echo "<a class='menu-li-a $active_class' href='".$echoUrl."' title='".$menu['title_'.Yii::app()->language]."'><strong>".$menu['title_'.Yii::app()->language]."</strong><span></span></a>";
}
Hope you sort it out :)

Related

How can I replace a hamburger menu to a default one in WordPress?

I'm using a built-in default WordPress theme called Scrawl for testing purposes. https://wordpress.org/themes/scrawl/
I was trying to edit the styles but nothing seems working. How can I replace a hamburger menu to a default horizontal navigation menu when viewing in desktop on WordPress? Any information would help!
#media screen and ( min-width: 1024px ) and (max-width: 1281px) {
.menu-toggle {
display: none;
}
.site-logo {
max-height: 100px;
}
.has-site-logo .main-navigation {
height: 100px;
}
.has-site-logo .main-navigation > div,
.has-site-logo .main-navigation > ul {
position: relative;
top: 50%;
-moz-transform: translateY(-50%);
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
}
.main-navigation {
font-size: 0.8125em;
line-height: 2.09231em;
clear: none;
float: right;
max-width: 50%;
text-align: right;
}
.main-navigation ul:first-child {
display: block;
}
.main-navigation ul li {
display: inline-block;
}
.main-navigation ul li:hover > ul,
.main-navigation ul li.focus > ul {
display: block;
opacity: 1;
visibility: visible;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
.main-navigation ul a {
border-bottom: 0;
padding: 5px 0 5px 14px;
}
.main-navigation ul ul {
background: white;
border: 1px solid #eeeeee;
display: none;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
float: left;
opacity: 0;
padding: 0 7px;
position: absolute;
top: 27px;
left: 0;
text-align: left;
visibility: hidden;
z-index: 99999;
}
.main-navigation ul ul li {
border-bottom: 1px solid #eeeeee;
padding: 5px 5px 4px;
}
.main-navigation ul ul li:last-of-type {
border-bottom: 0;
}
.main-navigation ul ul li a {
line-height: 1.5;
padding: 5px;
width: 180px;
}
.main-navigation ul ul ul {
left: 100%;
top: 0;
}
.main-navigation ul ul li a,
.main-navigation ul ul ul li a,
.main-navigation ul ul ul ul li a {
padding-left: 5px;
}
}
Here's my attempt of adding CSS code in the Customizer. I successfully removed the hamburger icon but the links aren't showing up. I didn't see the html structure for the links after I added the code, I was trying to add menus on the menus section but nothing changes.

Pictures getting lower

When I upload a picture from the admin panel, it gets shown, but the pictures get lower. I mean the first picture is in the right place, the second is a little lower than the first, then the third is even lower than the second, and so on...
My code:
<?php
include 'navbar.php';
?>
<!DOCTYPE html>
<html>
<head>
<title>Couture Collection</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</head>
<body>
<?php
include 'middle.php';
?>
<br>
<style type="text/css">
#import url(https://fonts.googleapis.com/css?family=Open+Sans:400,300);
body {
color: #333;
font-family: 'Open Sans', sans-serif;
font-weight: 300;
}
h1,
h1+p {
margin: 30px 15px 0;
font-weight: 300;
}
h1+p a {
color: #333;
}
h1+p a:hover {
text-decoration: none;
}
h2 {
margin: 60px 15px 0;
padding: 0;
font-weight: 300;
}
h2 span {
margin-left: 1em;
color: #aaa;
font-size: 85%;
}
.column {
padding: 0;
float: left;
}
.column:last-child {
padding-bottom: 60px;
}
.column::after {
content: '';
clear: both;
display: block;
}
.column div {
position: relative;
float: left;
width: 900px;
height: 200px;
margin: 0 0 0 25px;
padding: 0;
}
.column div:first-child {
margin-left: 0;
}
.column div span {
position: absolute;
bottom: -20px;
left: 0;
z-index: -1;
display: block;
width: 300px;
margin: 0;
padding: 0;
color: #444;
font-size: 18px;
text-decoration: none;
text-align: center;
-webkit-transition: .3s ease-in-out;
transition: .3s ease-in-out;
opacity: 0;
}
figure {
width: 300px;
height: 200px;
margin: 0;
padding: 0;
background: #fff;
overflow: hidden;
}
figure:hover+span {
bottom: -36px;
opacity: 1;
}
/* Zoom In #1 */
.hover01 figure img {
-webkit-transform: scale(1);
transform: scale(1);
-webkit-transition: .3s ease-in-out;
transition: .3s ease-in-out;
}
.hover01 figure:hover img {
-webkit-transform: scale(1.3);
transform: scale(1.3);
}
/* Zoom In #2 */
.hover02 figure img {
width: 300px;
height: auto;
-webkit-transition: .3s ease-in-out;
transition: .3s ease-in-out;
}
.hover02 figure:hover img {
width: 350px;
}
/* Zoom Out #1 */
.hover03 figure img {
-webkit-transform: scale(1.5);
transform: scale(1.5);
-webkit-transition: .3s ease-in-out;
transition: .3s ease-in-out;
}
.hover03 figure:hover img {
-webkit-transform: scale(1);
transform: scale(1);
}
/* Zoom Out #2 */
.hover04 figure img {
width: 400px;
height: auto;
-webkit-transition: .3s ease-in-out;
transition: .3s ease-in-out;
}
.hover04 figure:hover img {
width: 300px;
}
/* Slide */
.hover05 figure img {
margin-left: 30px;
-webkit-transform: scale(1.5);
transform: scale(1.5);
-webkit-transition: .3s ease-in-out;
transition: .3s ease-in-out;
}
.hover05 figure:hover img {
margin-left: 0;
}
/* Rotate */
.hover06 figure img {
-webkit-transform: rotate(15deg) scale(1.4);
transform: rotate(15deg) scale(1.4);
-webkit-transition: .3s ease-in-out;
transition: .3s ease-in-out;
}
.hover06 figure:hover img {
-webkit-transform: rotate(0) scale(1);
transform: rotate(0) scale(1);
}
/* Blur */
.hover07 figure img {
-webkit-filter: blur(3px);
filter: blur(3px);
-webkit-transition: .3s ease-in-out;
transition: .3s ease-in-out;
}
.hover07 figure:hover img {
-webkit-filter: blur(0);
filter: blur(0);
}
/* Gray Scale */
.hover08 figure img {
-webkit-filter: grayscale(100%);
filter: grayscale(100%);
-webkit-transition: .3s ease-in-out;
transition: .3s ease-in-out;
}
.hover08 figure:hover img {
-webkit-filter: grayscale(0);
filter: grayscale(0);
}
/* Sepia */
.hover09 figure img {
-webkit-filter: sepia(100%);
filter: sepia(100%);
-webkit-transition: .3s ease-in-out;
transition: .3s ease-in-out;
}
.hover09 figure:hover img {
-webkit-filter: sepia(0);
filter: sepia(0);
}
/* Blur + Gray Scale */
.hover10 figure img {
-webkit-filter: grayscale(0) blur(0);
filter: grayscale(0) blur(0);
-webkit-transition: .3s ease-in-out;
transition: .3s ease-in-out;
}
.hover10 figure:hover img {
-webkit-filter: grayscale(100%) blur(3px);
filter: grayscale(100%) blur(3px);
}
/* Opacity #1 */
.hover11 figure img {
opacity: 1;
-webkit-transition: .3s ease-in-out;
transition: .3s ease-in-out;
}
.hover11 figure:hover img {
opacity: .5;
}
/* Opacity #2 */
.hover12 figure {
background: #1abc9c;
}
.hover12 figure img {
opacity: 1;
-webkit-transition: .3s ease-in-out;
transition: .3s ease-in-out;
}
.hover12 figure:hover img {
opacity: .5;
}
/* Flashing */
.hover13 figure:hover img {
opacity: 1;
-webkit-animation: flash 1.5s;
animation: flash 1.5s;
}
#-webkit-keyframes flash {
0% {
opacity: .4;
}
100% {
opacity: 1;
}
}
#keyframes flash {
0% {
opacity: .4;
}
100% {
opacity: 1;
}
}
/* Shine */
.hover14 figure {
position: relative;
}
.hover14 figure::before {
position: absolute;
top: 0;
left: -75%;
z-index: 2;
display: block;
content: '';
width: 50%;
height: 100%;
background: -webkit-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,.3) 100%);
background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,.3) 100%);
-webkit-transform: skewX(-25deg);
transform: skewX(-25deg);
}
.hover14 figure:hover::before {
-webkit-animation: shine .75s;
animation: shine .75s;
}
#-webkit-keyframes shine {
100% {
left: 125%;
}
}
#keyframes shine {
100% {
left: 125%;
}
}
/* Circle */
.hover15 figure {
position: relative;
}
.hover15 figure::before {
position: absolute;
top: 50%;
left: 50%;
z-index: 2;
display: block;
content: '';
width: 0;
height: 0;
background: rgba(255,255,255,.2);
border-radius: 100%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
opacity: 0;
}
.hover15 figure:hover::before {
-webkit-animation: circle .75s;
animation: circle .75s;
}
#-webkit-keyframes circle {
0% {
opacity: 1;
}
40% {
opacity: 1;
}
100% {
width: 200%;
height: 200%;
opacity: 0;
}
}
#keyframes circle {
0% {
opacity: 1;
}
40% {
opacity: 1;
}
100% {
width: 200%;
height: 200%;
opacity: 0;
}
}
</style>
<?php
include 'admin/connect.php';
$sql = "SELECT * FROM products";
$run = mysqli_query($conn, $sql);
while ($row = $run->fetch_assoc()) {
$id = $row['id'];
?>
<div class="column">
<img src="<?php echo 'inventory_images/'.$id; ?>" style="width: 300px;height: 300px;padding-left: 50px;"/><br><br>
</div>
<br>
<br>
<?php
}
?>
<br>
<br>
<?php
include 'sale.php';
?>
<br>
<br>
<footer>
<?php
include 'footer.php';
?>
</footer>
</body>
</html>

Background overlays form in HTML/CSS

I tried to modify my site's background as you can see in the code, to make it more alive. But I'm struggling for few hours to find out why my background overlays the elements I have. Simply, it comes in front of everything. Why is that happening?
style.css
/* General Styles */
html{
background-color: #fff;
background-size: cover;
height:100%;
}
body {
color: #C0C0C0;
font-family: Arial, san-serif;
}
/* Contact Form Styles */
h1 {
margin: 10px 0 0 0;
}
h4{
margin: 0 0 20px 0;
}
#contact-form {
background-color:rgba(72,72,72,0.7);
padding: 10px 20px 30px 20px;
max-width:100%;
float: center;
left: 50%;
position: absolute;
margin-top:30px;
margin-left: -260px;
border-radius:7px;
-webkit-border-radius:7px;
-moz-border-radius:7px;
}
#contact-form input,
#contact-form select,
#contact-form textarea,
#contact-form label {
font-size: 15px;
margin-bottom: 2px;
font-family: Arial, san-serif;
}
#contact-form input,
#contact-form select,
#contact-form textarea {
width:100%;
background: #fff;
border: 0;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
margin-bottom: 25px;
padding: 5px;
color: #000;
}
#contact-form input:focus,
#contact-form select:focus,
#contact-form textarea:focus {
background-color: #E5E6E7;
}
#contact-form textarea {
width:100%;
height: 150px;
}
#contact-form button[type="submit"] {
cursor:pointer;
width:100%;
border:none;
background:#991D57;
background-image:linear-gradient(bottom, #8C1C50 0%, #991D57 52%);
background-image:-moz-linear-gradient(bottom, #8C1C50 0%, #991D57 52%);
background-image:-webkit-linear-gradient(bottom, #8C1C50 0%, #991D57 52%);
color:#FFF;
margin:0 0 5px;
padding:10px;
border-radius:5px;
}
#contact-form button[type="submit"]:hover {
background-image:linear-gradient(bottom, #9C215A 0%, #A82767 52%);
background-image:-moz-linear-gradient(bottom, #9C215A 0%, #A82767 52%);
background-image:-webkit-linear-gradient(bottom, #9C215A 0%, #A82767 52%);
-webkit-transition:background 0.3s ease-in-out;
-moz-transition:background 0.3s ease-in-out;
transition:background-color 0.3s ease-in-out;
}
#contact-form button[type="submit"]:active {
box-shadow:inset 0 1px 3px rgba(0,0,0,0.5);
}
input:required, textarea:required {
box-shadow: none;
-moz-box-shadow: none;
-webkit-box-shadow: none;
-o-box-shadow: none;
}
#contact-form .required {
font-weight:bold;
color: #E5E6E7;
}
/* Hide success/failure message
(especially since the php is missing) */
#failure, #success {
color: #6EA070;
display:none;
}
/* Make form look nice on smaller screens */
#media only screen and (max-width: 580px) {
#contact-form{
left: 3%;
margin-right: 3%;
width: 88%;
margin-left: 0;
padding-left: 3%;
padding-right: 3%;
}
}
#bg {
-moz-transform: scale(1.0);
-webkit-transform: scale(1.0);
-ms-transform: scale(1.0);
transform: scale(1.0);
-webkit-backface-visibility: hidden;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100vh;
z-index: 1;
}
#bg:before, #bg:after {
content: '';
display: block;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
#bg:before {
-moz-transition: background-color 2.5s ease-in-out;
-webkit-transition: background-color 2.5s ease-in-out;
-ms-transition: background-color 2.5s ease-in-out;
transition: background-color 2.5s ease-in-out;
-moz-transition-delay: 0.75s;
-webkit-transition-delay: 0.75s;
-ms-transition-delay: 0.75s;
transition-delay: 0.75s;
background-image: linear-gradient(to top, rgba(19, 21, 25, 0.5), rgba(19, 21, 25, 0.5)), url("http://www.wise-company.com/pref2/inf_permise/Rezervari/images/overlay.png");
background-size: auto, 256px 256px;
background-position: center, center;
background-repeat: no-repeat, repeat;
z-index: 2;
}
#bg:after {
-moz-transform: scale(1.125);
-webkit-transform: scale(1.125);
-ms-transform: scale(1.125);
transform: scale(1.125);
-moz-transition: -moz-transform 0.325s ease-in-out, -moz-filter 0.325s ease-in-out;
-webkit-transition: -webkit-transform 0.325s ease-in-out, -webkit-filter 0.325s ease-in-out;
-ms-transition: -ms-transform 0.325s ease-in-out, -ms-filter 0.325s ease-in-out;
transition: transform 0.325s ease-in-out, filter 0.325s ease-in-out;
background-image: url("http://www.wise-company.com/pref2/inf_permise/Rezervari/images/bg.jpg");
background-position: center;
background-size: cover;
background-repeat: no-repeat;
z-index: 1;
}
body.is-article-visible #bg:after {
-moz-transform: scale(1.0825);
-webkit-transform: scale(1.0825);
-ms-transform: scale(1.0825);
transform: scale(1.0825);
-moz-filter: blur(0.2rem);
-webkit-filter: blur(0.2rem);
-ms-filter: blur(0.2rem);
filter: blur(0.2rem);
}
body.is-loading #bg:before {
background-color: #000000;
}
* {
box-sizing:border-box;
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
-webkit-font-smoothing:antialiased;
-moz-font-smoothing:antialiased;
-o-font-smoothing:antialiased;
font-smoothing:antialiased;
text-rendering:optimizeLegibility;
}
This is the style, and I'm setting this background, in the html file, as follow:
<div id="bg"></div>
My website looks like this: http://www.wise-company.com/pref2/inf_permise/Rezervari/inmatriculare.php
Can you figure out why is that happening? Thanks !
It's easy, just change your z-index from 1 to -1 at your div#bg. Will fix it right away.
Try changing the z-index: -1 So that the div with background image will go behind all other elements.

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.

Duplicated Back-To-Top Button

One of my websites, www.makememodern.com, is displaying duplicate Back-To-Top buttons on all browsers when it should be showing one.
footer.php
<div id="back-to-top">Back to Top</div>
CSS
#back-to-top {
position: fixed;
z-index: 1000;
bottom: 20px;
right: 20px;
display: none;
}
#back-to-top a {
display: block;
width: 40px;
height: 40px;
background: #E45323 url(http://makememodern.com/wp-content/uploads/2014/05/backtotop.png) no-repeat center center;
text-indent: -9999px;
-webkit-border-radius: 100px;
-moz-border-radius: 100px;
border-radius: 100px;
-webkit-transition: 0.2s all linear;
-moz-transition: 0.2s all linear;
-o-transition: 0.2s all linear;
transition: 0.2s all linear
}
#back-to-top a:hover {
background-color: #222222;
}
HTML shows:
<div id="back-to-top" style="display: block;">Back to Top</div>
I achieve my desired results when I erase from the HTML directly above, but I can't figure out how to change it permanently.
Looks like you have a syntax error on line 790 in the view source.
<p>Copyright © 2014 Make Me Modern LLC, All rights reserved. <a href=</p>
Looks like there might be an extraneous link tag <a href=
If for whatever reason the <a href= is intentional, then it needs to be completed.
The main thing is, you're missing a closing tag on that line.
Your CSS is generating a different image for every a tag.
I suggest you to put the background image inside the #back-to-top style
#back-to-top {
position: fixed;
z-index: 1000;
bottom: 20px;
right: 20px;
display: none;
width: 40px;
height: 40px;
background: #E45323 url(http://makememodern.com/wp-content/uploads/2014/05/backtotop.png) no-repeat center center;
text-indent: -9999px;
-webkit-border-radius: 100px;
-moz-border-radius: 100px;
border-radius: 100px;
-webkit-transition: 0.2s all linear;
-moz-transition: 0.2s all linear;
-o-transition: 0.2s all linear;
transition: 0.2s all linear
}
#back-to-top a {
display: block;
}
#back-to-top:hover {
background-color: #222222;
}

Categories