CSS element doesn't show up in Chrome, but does on Firefox - css

I'm very new to all of this CSS business, so please forgive me if I'm missing something obvious. I'm using the 960.gz grid system to create a site at www.locodingo.com
I'm having an issue getting a light grey box (adBox in my CSS code) to show up on the right side of my website in Chrome underneath my menu, but it loads just fine in Firefox and Internet Explorer. I've messed with what seems like pretty much every variable but just can't get it to show. Please help!
* {
font-family:Arial, Verdana, sans-serif;
color:black;
}
#header {
background-color:#d3d3d3;
height:90px;
border-radius:10px;
position:absolute;
}
#header #logo {
height:80px;
padding:5px;
}
#nav li {
color:#F58535;
background-color:white;
float:right;
position:relative;
top:-99px;
right:0px;
text-align:left;
display:inline;
padding:7px;
font-weight:bold;
margin-right:15px;
border-radius:5px;
}
#nav2 li {
color:#6ABD50;
background-color:white;
position:relative;
display:inline-block;
float:right;
top:32px;
padding:7px;
font-weight:bold;
margin-right:15px;
border-radius:5px;
right:10px;
}
#nav li:hover {
background-color:#F58535;
color:white;
}
#nav2 li:hover {
background-color:#6ABD50;
color:white;
}
#adsBox {
height:250px;
background-color:#F2F3F3;
margin-top: 50px;
clear:right;
border-radius:10px;
display:inline-block;
}
#adsBox p {
margin:5px;
text-align:justify;
}
#footer {
position:relative;
background-color:black;
color:#F58535;
font-weight:bold;
font-family:sans-serif;
font-size:12px;
text-align:center;
height:20px;
clear:both;
}
bodyText{
right:122px;
position:relative;
float:left;
color:red;
display:block;
}

<div class="container_12 clearfix">
<div id="header" class="grid_12">
<img id="logo" src="images/logo.png"/>
<div id="nav">
<ul>
<li>Contact Us</li>
<li>Message Board</li>
<li>Opinion</li>
<li>Articles</li>
</ul>
</div>
</div>
</div>
<div id="nav2">
<ul>
<span><li>Cosplay</li></span>
<span><li>Tattoos</li></span>
<span><li>Music/Art</li></span>
<span><li>Recipes</li></span>
</ul>
</div>
<div class="container_12 clearfix">
<div id="bodyText" class="grid_8"><p>Just safdsfdadfafdfdome random stuff here.ust safdsfdadfafdfdome random stufust safdsfdadfafdfdome random stufust safdsfdadfafdfdome random stufust safdsfdadfafdfdome random stufust safdsfdadfafdfdome random stufust safdsfdadfafdfdome random stuf adggdadgsagddgsdsgagsd</p></div>
<div id="adsBox" class="grid_4"><p>Test text here est text hereTest text here est text hereTest text here est text hereTest text here est text hereTest text here est text hereTest text here est text hereTest text here est text hereTest text here est text here</p>
</div>
</div>

Do you have AdBlockPlus or any kind of adblocker extension in Chrome? If so, it's probably hiding that block based on its id.

jack was able to answer my issue for me. It was indeed AdBlockPlus blocking the div container because it was called "adsBox" and contained the word "ads". I feel pretty stupid - I guessthis is just one of those stupid little things I've got to learn about on my journey.
So, for future reference - don't name any container with the word "ads" in it.
Thank all of you for helping me out. Each and every one of you had valuable information that I'll be able to use.

Related

Div placement off in IE8

I know this fiddle isn't that great as It looks a little messy because I haven't included all of my code but you can get the general idea:
Fiddle
It works fine in FF and Chrome, but in IE8 the main chunk of text and the 3 divs underneath get all messed up and over-lap the menu on the left.
Is it something to do with position:relative that I need to include somewhere?
Something that I need to include to stop the divs over lapping?
Is there anyone that can check the fiddle in higher IE as I only have 8
I've managed to clean up the HTML and CSS a little but there are more changes you should consider making before moving forwards. I would definitely look at removing the duplication in the CSS, there are many duplicate properties which can be combined into a single property for multiple selectors. You should also make sure you are writing valid HTML, since this can also cause rendering problems across browsers.
See demo or example code below.
HTML
<div class="allinfo">
<div class="menu">
<div class="menutop">WATCHGUARD SHOP MENU</div>
<ul class="menuoptions">
<li><span class="redtext">WatchGuard Home</span>
</li>
<li>XTM Series Firewalls</li>
<li>XCS Series Firewalls</li>
<li>SSL VPN Encryption</li>
<li>Security In Education</li>
<li>Wireless Access Points</li>
<li>FREE Quotation</li>
</ul>
<div class="tradein">TRADE IN</div>
<div class="tradeininfo">
<strong>Trade Up</strong>
<p>Trade in an earlier generation WatchGuard appliance or any approved non-WatchGuard appliance-based security solution, and trade up to eligible new WatchGuard solutions at 25% off the standard purchase price.</p>
</div>
<div class="whitepapers">WHITEPAPERS</div>
<div class="whitepapersinfo">
<ul>
<li>Take Back Control</li>
<li>Data Loss Prevention</li>
<li>Securing the Virtual World</li>
</ul>
</div>
</div>
<div class="maintext">
<h5>Welcome To The WatchGuard Homepage</h5>
<br/>
<p>WatchGuard builds affordable, all-in-one network and content security solutions to provide defense in depth for corporate content, networks and the businesses they power.</p>
<p>WatchGuard's award-winning extensible threat management (XTM) network security solutions combine firewall, VPN and security services to protect networks from spam, viruses, malware and intrusions.</p>
<p>The new Extensible Content Security (XCS) appliances offer content security across e-mail and web combined with data loss prevention for complete content protection.</p>
<p>WatchGuard extensible solutions scale to offer right-sized security for small businesses up to enterprises with 10,000+ employees.</p>
<p>Since our founding in 1996, more than 600,000 WatchGuard signature red security appliances have been deployed worldwide. Today more than 15,000 dedicated partners back our products in 120 countries.</p>
<div class="products">
<div class="product"> <span>WatchGuard SSL/VPN</span>
<br/>
<br/>
<br/>
<img src="images/watchguard-tb-ssl.jpg" width="199" />
<br/>
<br/>
<p>Remote connectivity. Secure remote access that just works.</p>
</div>
<div class="product"> <span>WatchGuard XCS</span>
<br/>
<br/>
<br/>
<img src="images/watchguard-tb-xcs.jpg" width="117" height="72" />
<br/>
<br/>
<p>Content security. Defense in-depth email security and web security.</p>
</div>
<div class="product"> <span>WatchGuard XTM</span>
<br/>
<br/>
<br/>
<img src="images/watchguard-tb-xtm.jpg" width="122" height="72" />
<br/>
<br/>
<p>Multi-function firewalls. Incredible speed. Unbelievable value.</p>
</div>
</div>
</div>
</div>
CSS
.redtext {
color:#DF0005;
}
.banner {
position:relative;
top:10px;
}
.menu, .maintext {
display:table-cell;
padding:10px;
}
.maintext {
height:500px;
font-size:smaller;
font-weight:normal;
vertical-align:top;
margin-left:240px;
}
.maintext h5 {
font-weight:lighter;
}
.menu {
position:relative;
width:235px;
}
.menutop {
height:30px;
background-color:rgb(221, 221, 221);
color:#666;
line-height:30px;
font-weight:bold;
border-style:solid;
border-width:1px;
border-color:#CCC;
text-indent:10px;
font-size:smaller;
}
.menuoptions {
color:#666;
line-height:30px;
font-weight:bold;
list-style:none;
padding: 0;
font-size:smaller;
}
.menuoptions li {
border-bottom:solid 1px #ccc;
padding-left:10px;
}
.tradein {
background-color:rgb(221, 221, 221);
color:#666;
line-height:30px;
font-weight:bold;
border-style:solid;
border-width:1px;
border-color:#CCC;
text-indent:10px;
font-size:smaller;
}
.tradeininfo {
color:#333;
border-style:solid;
border-width:1px;
border-color:#CCC;
padding:10px;
font-size:smaller;
}
.whitepapers {
background-color:rgb(221, 221, 221);
color:#666;
line-height:30px;
font-weight:bold;
border-style:solid;
border-width:1px;
border-color:#CCC;
text-indent:10px;
font-size:smaller;
}
.whitepapersinfo {
color:#666;
border-style:solid;
border-width:1px;
border-color:#CCC;
line-height:30px;
font-weight:bold;
font-size:smaller;
}
.whitepapersinfo li:not(:last-child) {
border-bottom:solid 1px #ccc;
}
.product {
position:relative;
width:205px;
height:205px;
border-style:solid;
border-width:1px;
border-color:#CCC;
margin:5px;
padding:10px;
text-align:center;
display:inline-block;
vertical-align:top;
}
.product span {
position:relative;
font-size:18px;
margin:0 auto;
color:#333333;
}
.product p {
text-align:left;
font-size:smaller;
color:#333333;
}

img move to bottom after float right

img moved to bottom after float:right;
see to footer: http://qass.im/thestandard/
this footer code:
footer{
display:block;
margin:0 auto;
margin-bottom:50px;
width:800px;
height:100%;
clear:both;
}
.footer-content{
padding:80px;
padding-top:0;
padding-bottom:0;
}
footer p{
line-height: 1.714285714;
font-size:14px;
color:#555;
}
footer p a{
color:#555;
border-bottom:1px dotted #555;
}
.social-icon{
font-size:0;
float:right;
}
Do it this way.
The Code Changes:
<div class="footer-content">
<div class="social-icon">
<a target="_blank" href="#"><img src="http://qass.im/thestandard/wp-content/themes/thestandard/images/twitter-footer.png"></a>
<a target="_blank" href="#"><img src="http://qass.im/thestandard/wp-content/themes/thestandard/images/facebook-footer.png"></a>
<a target="_blank" href="#"><img src="http://qass.im/thestandard/wp-content/themes/thestandard/images/google-footer.png"></a>
</div>
<p>
Powered by <a target="_blank" href="http://wordpress.org">WordPress</a> ©2013 The Standard, The Standard theme by <a target="_blank" href="http://qass.im/thestandard">Qassim.Dev</a>
</p>
</div>
This will make your image not to jump to the bottom.
They are rendered under the paragraph. As a p tag is block-level - so it occupies the full width.
What you can do:
variant 1: make .footer-content p {float: left;}
variant 2: change the order in your html. Make the div with a class of social-icon go before the paragraph.
delete the .social-icon's float
and use display:inline; for .social-icon and footer p
i have visited your page it isnt on the bottom because of float:right; (use a debugger - like firebug - and disable float:right; to check), its there because of the fact that it is a block element under another block element use display:inline-block; in your .social-icon and footer p css.
in conclusion
footer p{
display:inline-block;
}
.social-icon{
display:inline-block;
font-size:0;
float:right;
}
and BOOM! i did this in firebug on your site and it worked fine.

div border positioning

I am having trouble positioning a border in a div id. The border doesn't follow the text within the div.
My HTML looks like this:
<div id="menu-left-top">
<ul class="menu-left-top">
<li>Kategorier</li>
</div>
<div id="menu-left">
<ul class="menu-left">
<li>Lamper</li>
<li>Møbler</li>
<li>Kunst</li>
<li>Design</li>
</div>
And this is my CSS:
#menu-left-top {
width:195px;
height:1em;
margin-top:5px;
border-top-style:solid;
border-width:thin;
border-color: #999;
}
ul.menu-left-top {
list-style-type: none;
height:1em;
}
ul.menu-left-top li{
}
ul.menu-left-top li a{
color:#000;
font-size:12px;
text-decoration:none;
font-family: "Gill Sans light";
}
ul.menu-left-top li a:hover{
color:#cf0036;
font-size:12px;
text-decoration:none;
font-family:"Gill Sans light";
font-weight:300;
}
#menu-left {
width:195px;
max-height:4em;
margin-top:5px;
border-top-style:solid;
border-bottom-style:solid;
border-width:thin;
border-color: #999;
}
ul.menu-left {
list-style-type: none;
}
ul.menu-left li{
}
ul.menu-left li a{
color:#000;
font-size:12px;
text-decoration:none;
font-family: "Gill Sans light";
}
ul.menu-left li a:hover{
color:#cf0036;
font-size:12px;
text-decoration:none;
font-family:"Gill Sans light";
font-weight:300;
}
You can see the result here. It's the navigation to the left that is my current problem. As you can see, the div floating right also has faults, but I don't know if it has anything to do with my initial problem?
No issue buddy, but for this also we dont need to separate the first menu item from others,
check these,
your html code will be like this :
<div id="menu-left">
<ul class="menu-left">
<li class="first">Kategorier</li>
<li>Lamper</li>
<li>Møbler</li>
<li>Kunst</li>
<li class="last">Design</li>
</ul>
</div>
if you want it like this
then you can use this css :
.first { border:#000 solid; }
.last{ border-bottom:#000 solid; }
and if you want it like this then you can use this :
.first { border-top:#000 solid; }
.last { border-bottom:#000 solid; }
you can use this for this
.first { border-top:#000 solid;
border-bottom:#000 solid; }
.last{ border-bottom:#000 solid; }
Remove the max-height property of the menu-left div.
there is a max-height? remove max-height:4em; or you can make it height:auto;
You have not closed your ul tags in this way , as you start any html tag also you have to end the html tag, this is for most of the m\html tags, so this is the main fault here, firstly you need to close your ul's ,
<div id="menu-left-top">
<ul class="menu-left-top">
<li>Kategorier</li>
</ul>
</div>
<div id="menu-left">
<ul class="menu-left">
<li>Lamper</li>
<li>Møbler</li>
<li>Kunst</li>
<li>Design</li>
</ul>
</div>
And the massive border around your list elements are coming due to
border-top-style:solid;
border-bottom-style:solid;
this is not a proper way to bordering, you can use as border:2px soild #00000; , and for more on this kindly update your layout here, just give me a blueprint of how you want to make it look, then i will help you in formatting these. Cheers. and use height:auto also
Use html format like this , as we do not need to differ the top menu, we can achieve this via this thing :
use this html code :
<div id="menu-left">
<ul class="menu-left">
<li class="first">Kategorier</li>
<li>Lamper</li>
<li>Møbler</li>
<li>Kunst</li>
<li>Design</li>
</ul>
</div>
and then the css changes are as :
.first { border-top:#000 solid; }
ul.menu-left li{
border-bottom:#000 solid;
}
this will make something like this, and border styles you can change according to you, if any queries then feel free to ask,

Difficulty creating a content grid layout using css and html

I am trying to create a grid layout using tags and css. I need the grid system to hold four main blocks as portrayed in the image below. I have created a solution that works great in safari and chrome, but not so well in firefox as the titles overlap. Please see my code below, and maybe someone can see where I have gone wrong! I cant for the life of me find the problem.
HTML CODE:-
<div class="elements_wrapper">
<div id="element1">
<img class="align-image" src="img/image1"/>
<span class="element-title">Title</span>
<p class="element-explain">Main text goes here</p>
</div>
<div id="element2">
<img class="align-image" src="img/image2"/>
<span class="element-title">Title</span>
<p class="element-explain">Main text goes here</p>
</div>
<div id="element3">
<img class="align-image" src="img/image3"/>
<span class="element-title">Title</span>
<p class="element-explain">Main text goes here</p>
</div>
<div id="element4">
<img class="align-image" src="img/image4"/>
<span class="element-title">Title</span>
<p class="element-explain">Main text goes here</p>
</div>
</div>
CSS CODE:-
.elements_wrapper {
width:100%;
margin-left:-65px;
margin-top:110px;
padding-bottom:30px;
}
#element1{
position:absolute;
display:inline-block;
margin-left:30px;
padding-bottom:20px;
}
#element2 {
position:absolute;
display:inline-block;
margin-top:200px;
margin-left:30px;
padding-bottom:20px;
}
#element3 {
position:absolute;
display:inline-block;
margin-left:545px;
margin-top:200px;
padding-bottom:20px;
}
#element4 {
position:absolute;
display:inline-block;
margin-left:545px;
padding-bottom:20px;
}
.element-title {
font-family:helvetica, arial, serif;
color:black;
display:inline;
font-size:14pt;
font-weight:bold;
padding-top:15px;
}
.element-explain {
font-family:helvetica, arial, serif;
font-size:10pt;
float:left;
width:280px;
}
.align-image {
border: none;
float:left;
padding-right:15px;
}
My code works great in safari and chrome, but not that well in firefox, please help. Also, please let me know if the code I have already used is bad or needs changing to ensure cross browser compatibility. Thanks so much.
See the next example: http://jsfiddle.net/ZNSAX/2/
.element-explain {
font-family:helvetica, arial, serif;
font-size:10pt;
float:left;
width:280px;
}
Floating left here will cause this error. Firefox is a bit finicky with floating elements than Chrome and IE. Removing this should fix your problem.

Why does the background of my container/wrapper not extend behind all content

Im working on a portfolio for uni and the background of my container / wrapper does not extend vertically enough in order for all its content to have a back ground color. I'll post code below, any help would be appreciated.
HTML
<body>
<section id="wrapper">
<header>
<hgroup class="title">
<h1>Matt Murphy</h1>
<p>Personal Portfolio | University of Leeds | BA New Media</p>
</hgroup>
</header>
<nav>
Home
About Matt
</nav>
<section id="modules">
<h2>Modules Studies To Date</h2>
<section id="year_1">
<h3>Year 1</h3>
<p>History of Communications</p>
<p>Academic Skills and Contemporary Issues</p>
<p>Interface Design</p>
<p>Design For New Media</p>
<p>Basic Camera and Editing</p>
<p>Animation For New Media</p>
</section>
<section id="year_2">
<h3>Year 2</h3>
<p>Dynamic Web Programming</p>
<p>Communications Research Methods</p>
<p>Working in New Media/p>
<p>Media Policy</p>
<p>New Media Narrative and Gaming</p>
<p>Visual Communications</p>
</section>
</section>
</section>
</body>
CSS
body{
color:#000;
background-image: url(images/canvas.png);
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
}
a:link {
text-decoration:none;
color:#000;
}
a:visited {
text-decoration:none;
color:#000;
}
a:hover {
text-decoration:none;
color:#000;
}
a:active {
text-decoration:none;
color:#000;
}
#wrapper {
background-color:#FFF;
padding:3%;
-webkit-border-radius: 25px;
-moz-border-radius: 25px;
border-radius: 25px;
display:block;
margin:auto;
width:60%;
margin-top:2%;
}
header {
text-align:right;
}
#modules {
width:100%;
display:block;
margin:auto;
}
#year_1 {
float:left;
}
#year_2 {
float:left;
}
To fix your problem you just need to add overflow: auto to #wrapper.
#wrapper {
background-color:#FFF;
padding:3%;
-webkit-border-radius: 25px;
-moz-border-radius: 25px;
border-radius: 25px;
display:block;
margin:auto;
width:60%;
margin-top:2%;
overflow: auto; /* add this line */
}
However, another issue is that you are using HTML5 elements and the HTML5 shiv but you have not used the HTML5 doctype:
<!DOCTYPE html>
I assume you are having problems in IE? You are missing a doctype declaration. If you add a transitional doctype as per the example on W3Schools below it should work.
HTML doctype declaration
Basically the css-property 'float' on the section#year is the bad guy here.
If I replace your sections with div's and add an extra div to clear block rendering it works:
http://jsfiddle.net/hoedinie/537sL/1/

Resources