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;
}
Related
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.
I use Socialengine (Zend Framework) with lot of plugin but one of plugin has a different CSS.
In fact there are lot of CSS cascading but isn't less or sass file.
My file style.css looks like this :
/*Mixins*/
=font-size($px){
font-size: calc($px/13)em;
}
=transition{
-webkit-transition: all 300ms ease-in-out;
-o-transition: all 300ms ease-in-out;
transition: all 300ms ease-in-out;
}
=border-radius($radius) {
-webkit-border-radius: $radius;
-moz-border-radius: $radius;
border-radius: $radius;
}
=text-clamp($line) {
word-break: break-word;
word-wrap: break-word;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
line-height: normal;
-webkit-line-clamp: $line;
line-height: 18px;
height: calc(18*$line)px;
}
/* CSS */
.blog_options{
display: block;
position: absolute;
width: 170px;
right: 0;
border: 1px solid $theme_border_color;
background: #FFF;
display: none;
box-shadow: 0px 0px 21px -5px #ccc;
&.blog_options_show{
display: block;
}
& > a{
padding: 10px 15px;
display: block;
+font-size(13);
border-bottom: 1px solid $theme_border_color;
color: $theme_font_color !important;
&:hover{
background: $theme_link_color_hover;
color: #FFF !important;
}
i.fa{
+font-size(14);
margin-right: 5px;
}
&:last-of-type{
border-bottom: 0;
}
&.icon_blog_delete{
color: #c31919 !important;
background: #f6f6f6 !important;
i.fa{
color: #c31919;
}
}
}
}
So how I can compile this manually for have a clean CSS file ?
This type of CSS have a name ?
Thank you
since i don't have more knowledge about socialengine script, but it use CSScaffold in css compiling.
Review the repository for more information.
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 >).
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">  <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.
I want to center a combination of css buttons in a page. I have set display: inline-block;. But they are aligning to left. I could center them if I add an additional div as parent element for the both and set them a id giving it a display:block.
Here is the css:
.q-button {
background-color: green;
color: #FFF;
min-width: 144px;
text-decoration: none;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
border: none;
outline: none;
height: 38px;
margin-right: 10px;
margin-bottom: 20px;
line-height: 45px;
font-size: 12px;
padding: 0 20px;
font-weight: bold;
-webkit-transition: all .2s linear;
-moz-transition: background .2s linear;
-o-transition: all .2s linear;
-ms-transition: all .2s linear;
transition: all .2s linear;
display: inline-block;
text-transform: none;
position: relative;
}
.q-button a {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 45px;
text-decoration: none;
z-index: 10;
}
#q-button-container{
left: 0;
right: 0;
margin: auto;
width: 49px;
display: block;
display: inline-block;
}
This is the code (custom function in WordPress theme. get_field is of Advanced Custom fields'):
function custom_content_filter_the_content( $content ) {
if ( function_exists('get_field') ) {
$content .= '<span class="q-button" id="q-button-container" data-icon="a">' . get_field('website') . '</span>';
$content .= '<span class="q-button" id="q-button-container" data-icon="a">' . get_field("website2") . '</span>';
}
return $content;
}
add_filter( 'the_content', 'custom_content_filter_the_content' );
Could any body suggest me how to do it keeping the php code intact and by just customizing the css?
Update: I was able to center the buttons after wrapping them with a new class. But here I am only able to center them if I use text-align:center. That temporarily enabled me achieve what I need. But I want to know why can't I achieve in the usual way- Fiddle
If you can consider using jQuery to wrap a div around the buttons, you can use this:
jQuery wrap All
$( ".q-button" ).wrapAll( "<div class='q-button-wrap' />");
Then you can apply css to .q-button-wrap.
Hope this helps.
easy to do just use display: inline-block
http://jsfiddle.net/robbiebardijn/q745U/
display: inline-block;
Wrap both the spans in a parent element and center that element.