/    Sign up×
Community /Pin to ProfileBookmark

CSS issue with Chrome only

Tested this page:

[URL=”http://www.protecoitalia.it/ita/confezioni-food/affettati-e-carni-fresche.html”]http://www.protecoitalia.it/ita/confezioni-food/affettati-e-carni-fresche.html[/URL]

with FF and various version of IE (ignoring IE6) and everything works fine.

With Chrome, [B]#maincol-nav[/B] is shifted to the left side. If I change the CSS to correct the issues, the problem disappear in Chrome but happens in FF.

Here the CSS I use, pls note the part about [B]#maincol-nav[/B]. Thanks in advance.

[CODE]

html, body{
margin:0;
padding:0;
text-align:center;}

body {position:relative;}

h1 {
font-family:Arial, Helvetica, sans-serif;
font-size:18px;
font-weight:bold;
font-style:oblique;
padding-top:25px;
padding-left:300px;
color:#FFF;
float:left;
clear:right;
text-indent:-25px;
}

#pagewidth{
width:750px;
text-align:left;
margin-left:auto;
margin-right:auto;
margin-top:10px;
margin-bottom:5px;
border:#999 thin solid;
padding:5px;
}

#header, #header-eng{
position:relative;
height:120px;
width:100%;
background-repeat:no-repeat;
background-position:left;
background-color:#ccff99;
}

#header{background-image:url(../img/proposte-tecniche-per-il-confezionamento.png);}

#header-eng{background-image:url(../img/technical-proposal-for-packaging.png);}

#header img, #header-eng img{
float:right;
display:block;
}

#wrapper {
padding-top:5px;
background-color:#ccff99;
}

#leftcol{
float:left;
position:relative;
margin-top:4px;}

html>body #leftcol { width:19%;
background-color:#ccff99;}

#leftcol ul{
margin-top:0px;
list-style-type:none;
text-transform:uppercase;
font-family:Verdana, Geneva, sans-serif;
font-size:11px;
font-weight:bold;}

html>body #leftcol ul{
margin-left:-40px;}

#leftcol li {
width:100%;}

html>body #leftcol li {
border-bottom:3px #fff solid;
}

#leftcol li.last {
border-bottom:0px;
}

#leftcol a {
display:block;
padding-left:6px;
text-decoration:none;
padding-top:5px;}

html>body #leftcol a {
padding-bottom:5px;}

#leftcol a:link, #leftcol a:visited, #leftcol a:active {
color:#00762a;
background-color:#ccff99;}

#leftcol a:hover {
color:#fff;
background-color:#00762a;}

#leftcol a.current {color:#ccff99; background-color:#00762a;}

#twocols{
width:81%;
float:right;
position:relative;
background-color:#ccff99;
padding-bottom:10px;}

#maincol{background-color: #FFF;
height:219px;
float: left;
display:inline;
position: relative;
width:56%;
margin-top:4px;}

#maincolscroll.scroll{background-color: #FFF;
height:189px;
margin-top:4px;
float:left;
display:inline;
position: relative;
width:56%;
border-top:#fff 30px solid;}

#maincolscroll.scrollpress{background-color: #FFF;
height:189px;
margin-top:4px;
float:left;
display:inline;
position: relative;
width:56%;
border-top:#fff 30px solid;}

#maincol p{
width:99%;
padding-left:5px;
line-height:1.3;
font-family:Arial, Helvetica, sans-serif;
font-size:11.5px;
text-align:left;
color:#333;}

#maincolscroll img {
margin-right:2px;
border:0px;}

#maincolscroll.scroll p{
display:block;
margin-right:2px;
line-height:1.3;
font-family:Arial, Helvetica, sans-serif;
font-size:11.5px;
text-align:left;
color:#333;
padding-right:80px;
padding-bottom:2px;}

html>body #maincolscroll.scroll p{
width:99%;
padding-left:4px;
}

#maincolscroll.scrollpress p{
width:100%;
display:block;
margin-right:2px;
line-height:1.3;
font-family:Arial, Helvetica, sans-serif;
font-size:11.5px;
text-align:left;
color:#333;
padding-right:80px;
padding-left:4px;
padding-bottom:2px;}

.scroll {
overflow-y:scroll;
overflow-x:hidden;}

.scrollpress {
overflow-y:hidden;
overflow-x:hidden;}

.firstline {padding-top:25px;}

.lastline {
display:block;
padding-bottom:125px;
padding-top:16px;}

#stondatura {
position:absolute;
display:block;
margin-top:4px;
}

html>body #stondatura {margin-left:-19px;
z-index:1;}

.bold {
font-weight:bold;
}

.boldup {
font-weight:bold;
text-transform:uppercase;
}

.boldqualita {
display:block;
font-weight:bold;
padding-top:60px;
}

html>body #maincol-nav{
float: left;
position:absolute;
padding-left:3px;
margin-left:-340px;
width:100%;
z-index:1;
top: 1px;
display:inline;}

html>body #maincol-nav ul{
margin-left:-40px;
margin-top:3px;}

html>body #maincol-nav li{
list-style-type:none;
display:inline-block;
margin-left: 2px;}

html>body #maincol-nav a {
float:left;
text-align:center;
font-size:13px;
font-family:Arial, Helvetica, sans-serif;
font-weight:bold;
color:#00762a;
text-decoration:none;
display:block;
background-color:#ccff99;
padding:1px 2px 0px 2px;}

html>body #maincol-nav a.singleline {
padding: 7px 2px 10px 2px;}

html>body #maincol-nav a:hover {
background-color:#00762a;
color:#fff;}

html>body #maincol-nav a.current {color:#ccff99; background-color:#00762a;}

html>body #maincol-nav a.singlelinecurrent {
padding: 7px 2px 10px 2px;
color:#ccff99; background-color:#00762a;}

#rightcol{
width:271px;
position:absolute;
margin-top:4px;}

html>body #rightcol {margin-left:337px;}

#rightcol img {
display:block;
}

#impianti, #film {
float:left;
width:271px;
position:absolute;
}

#impianti {
margin-top:-160px;
}

#film {
margin-top:-115px;
}

#impianti a, #film a {
color:#00762a;
font-family:Verdana, Geneva, sans-serif;
font-size:12px;
font-weight:bolder;
text-transform:uppercase;
text-indent:25px;
text-decoration:none;
display:block;
width:100%;
background-color:#FFF;
filter: alpha(opacity=75);
-moz-opacity: 0.75;
opacity: 0.75;
padding-top: 10px;
padding-right: 0px;
padding-bottom: 10px;
padding-left: 0px;
}

#impianti a:hover, #film a:hover {
filter: alpha(opacity=100);
opacity: 1;
}

#footer{
height:142px;
background-color:#00762a;
clear:both;
padding-top:22px;
}

#imgdown {
display:block;
float:right;
z-index:1;
margin-top:-137px;}

html>body #imgdown {
margin-left:479px;
position:absolute;}

#petalo {
display:block;
float:right;}

html>body #petalo{
position:absolute;
z-index:2;
margin-top:-106px;
margin-left:562px;}

#petalo-text {
text-transform:uppercase;
text-align:center;
font-family:Arial, Helvetica, sans-serif;
font-size:14px;
display:block;
text-decoration:none;
z-index:3;
position:absolute;
float:right;
margin-top:-60px;
margin-left:625px;}

#petalo-text-eng {
text-transform:uppercase;
text-align:center;
font-family:Arial, Helvetica, sans-serif;
font-size:14px;
display:block;
text-decoration:none;
z-index:3;
position:absolute;
float:right;
margin-top:-65px;
margin-left:610px;}

#petalo-text.ptext, #petalo-text-eng.ptext {
color:#00762a;
}

#petalo-text.ptext:hover, #petalo-text-eng.ptext:hover {
color:#00762a;
font-weight:bold;
}

#verde {
background-color:#00762a;
width:20px;
height:120px;
position:absolute;
margin-top:-5px;
margin-left:0px;
}

#footer-2 {
text-align:center;
font-family:Verdana, Geneva, sans-serif;
color:#666;
font-size:10px;
}

/* *** Float containers fix:
http://www.csscreator.com/attributes/containedfloat.php *** */
.clearfix:after {
content: “.”;
display: block;
height: 0;
clear: both;
visibility: hidden;
}

.clearfix{display: inline-block;}

[/CODE]

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@letmehaveagoApr 10.2010 — Hi, remove the margin-left: -340px declaration and replace with left: 0px

That will work in all browsers.

It seems like position: absolute is being ignored some how because of a conflict with display-inline - if you believe chrome is rendering it correctly.

Another note is your code is xhtml but you declared your doctype as html!
Copy linkTweet thisAlerts:
@alexthecattaauthorApr 11.2010 — left: 0px works perfect, thanks a lot.

about your last point your code is xhtml but you declared your doctype as html![/QUOTE], isn't it HTML code the one I'm using in the site? Cna you pls explain me what I'm doing wrong?

thanks

A.
Copy linkTweet thisAlerts:
@letmehaveagoApr 18.2010 — There are subtle differences between html and xhtml.

A great reference place is http://www.w3schools.com/xhtml/xhtml_html.asp
×

Success!

Help @alexthecatta spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...