Web Design Forum: CSS Layouts - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

CSS Layouts Why so different between IE and FF

#1 User is offline   Neil Harding 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 112
  • Joined: 20-March 08
  • Reputation: 0
  • Location:Wales
  • Experience:Beginner
  • Area of Expertise:Coder

Posted 31 July 2008 - 07:52 PM

Hi,

I'm doing my nut in here, why is i do a layout in CSS as i'm moving away from tables and trying to get into the 21st C, but finiding SO Hard to get a simple layout design to work!

More of a rant than a question.

I have attached the layout i'm trying to get at. Of course the colours on the Div's are only to show you the layout. The red glow needs to go around the menu, content and footer only.


Any help tips on getting something like this working in IE and FF??

Attached File(s)


0

#2 User is offline   Mesa 

  • Expert
  • PipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 769
  • Joined: 30-July 08
  • Reputation: 5
  • Gender:Male
  • Location:Wirral
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 31 July 2008 - 08:05 PM

All browsers render differently, IE is the bain of a designers life sometimes. There are loads of "hacks" you can learn but I found (find) the hardest bit is knowing them in the 1st place.

It could be a double margin bug in IE, are you using floated elements? We really need more info.
0

#3 User is offline   Rachael 

  • Princess.
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,390
  • Joined: 14-October 07
  • Reputation: 0
  • Location:Northants, UK
  • Experience:Advanced
  • Area of Expertise:Designer/Coder

Posted 31 July 2008 - 08:06 PM

http://blog.html.it/layoutgala/ ?
0

#4 User is offline   gav 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 88
  • Joined: 29-March 08
  • Reputation: 5
  • Gender:Male
  • Location:Manchester, UK
  • Experience:Web Guru
  • Area of Expertise:Coder

Posted 31 July 2008 - 08:11 PM

if you code the site properly, there is no need for any "hacks"
0

#5 User is offline   Mesa 

  • Expert
  • PipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 769
  • Joined: 30-July 08
  • Reputation: 5
  • Gender:Male
  • Location:Wirral
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 31 July 2008 - 08:56 PM

View Postgav, on Jul 31 2008, 21:11, said:

if you code the site properly, there is no need for any "hacks"


Disagree if IE (for example) conformed to stricter ACID testing and complied to standards better then you wouldn't need to "dumb down" your design so it renders properly on ALL browsers. Likewise if people upgraded their browser to the latest versions.
0

#6 User is offline   gdehms 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 123
  • Joined: 07-May 08
  • Reputation: 0
  • Experience:Beginner
  • Area of Expertise:Designer

Posted 31 July 2008 - 09:32 PM

This is a pretty simple layout. But copying code from a website won't help unless you understand the code.

Around all of the separate divs you have (header, you are here, menu, content, and footer), you will want to have a 'wrapper' div. Why wrapper? Because it wraps around everything. Give the wrapper div a width, which will be the width throughout. Make the wrapper's margins on the left and on the right auto to get it centered.

Because the header and everything else are going to be separate, I would put another div around everything else, so you can give it a separate background from the header div.

In the everything else div, you will have four divs (you can probably use less, but this is just what i do).

For the you are here bar, just give it a height and I think you will be ok.

For the menu, give it a width and float it left. Give content the menu's width subtracted from the wrapper's width. Float left (This way if you want to add another column, you just add it and float it, and it will pretty much work off that bat).

Then for the footer, you will want to give it 'clear:both' and of course a height. This will make sure that it is clear from both the menu and the content divs, because they are floated.

That's the general idea, I think. Feel free to correct anything that seems wrong. This should work for all browsers.

Edit: If you do encounter IE 6 or 7 problems, make a separate css file called 'iestyle.css' or something. Here's how you put it in the html:

	<link href="style.css" rel="stylesheet" type="text/css" />
	<!--[if IE 6]><link href="iestyle.css" rel="stylesheet" type="text/css" /><![endif]-->
	<!--[if IE 7]><link href="ie7style.css" rel="stylesheet" type="text/css" /><![endif]-->


This way you only have to put the changes you want to make for Internet Explorer in their specific css file (all the other stuff that will be kept the same doesn't need to be in the ie style). This is because all the normal css is loaded first (style.css), and then the specifics are overridden if it is internet explorer 6 or 7. No hacks, just extra style sheets.
0

#7 User is offline   Neil Harding 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 112
  • Joined: 20-March 08
  • Reputation: 0
  • Location:Wales
  • Experience:Beginner
  • Area of Expertise:Coder

Posted 31 July 2008 - 09:34 PM

View PostMesa, on Jul 31 2008, 21:05, said:

All browsers render differently, IE is the bain of a designers life sometimes. There are loads of "hacks" you can learn but I found (find) the hardest bit is knowing them in the 1st place.

It could be a double margin bug in IE, are you using floated elements? We really need more info.


Yeah i have been using floats but it just doesn't work. I've wiped the slate clean and going to start recoding tomorrow and will post the resaults.
0

#8 User is offline   ElanMan 

  • In, out, shake it all about...
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 3,291
  • Joined: 11-March 08
  • Reputation: 53
  • Gender:Male
  • Location:Darlington
  • Experience:Nothing
  • Area of Expertise:Nothing

Posted 31 July 2008 - 09:42 PM

As a very rough and ready example, take a look at this.
I couldn't be arsed to mess about with a gradient glow but hopefully you get the idea. :)
The layout itself is very straightforward.
I've had to put a defined height on the divs to give you an idea of the layout.
There are lots of threads on the forum about shadow/glow effects on divs so have a little search about and I'm sure you'll find something to help you.
This basic layout shouldn't need any hacks for any browser.
Hope that helps :)
0

#9 User is offline   shubox 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 137
  • Joined: 01-May 08
  • Reputation: 0
  • Gender:Male
  • Location:Leeds, UK
  • Experience:Advanced
  • Area of Expertise:Designer/Coder

Posted 31 July 2008 - 11:11 PM

View Postgav, on Jul 31 2008, 21:11, said:

if you code the site properly, there is no need for any "hacks"

It depends how you define 'hack'. But IE6 will often require extra conditional css in order to mimic the expected layout of a perfectly marked-up web page. It's a non-standards compliant web browser and as such requires 'hacks'.
0

#10 User is offline   Mesa 

  • Expert
  • PipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 769
  • Joined: 30-July 08
  • Reputation: 5
  • Gender:Male
  • Location:Wirral
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 01 August 2008 - 08:26 AM

View Postshubox, on Aug 1 2008, 00:11, said:

It depends how you define 'hack'. But IE6 will often require extra conditional css in order to mimic the expected layout of a perfectly marked-up web page. It's a non-standards compliant web browser and as such requires 'hacks'.


Agreed. Should be a required update pushed on all redundant browser users. :crazy:
0

#11 User is offline   Neil Harding 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 112
  • Joined: 20-March 08
  • Reputation: 0
  • Location:Wales
  • Experience:Beginner
  • Area of Expertise:Coder

Posted 01 August 2008 - 09:12 AM

I think i'm getting it. Don't use IE lol.

Will take all on board and give it a go today at somepoint.
0

#12 User is offline   Rachael 

  • Princess.
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,390
  • Joined: 14-October 07
  • Reputation: 0
  • Location:Northants, UK
  • Experience:Advanced
  • Area of Expertise:Designer/Coder

Posted 01 August 2008 - 09:13 AM

Quote

But IE6 will often require extra conditional css in order to mimic the expected layout of a perfectly marked-up web page.


Depends on what sort of layout. A simple two / three column one shouldn't be a problem. I've been marking up websites for over two years and only needed to use a conditional stylesheet *once*.
0

#13 User is offline   Neil Harding 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 112
  • Joined: 20-March 08
  • Reputation: 0
  • Location:Wales
  • Experience:Beginner
  • Area of Expertise:Coder

Posted 02 August 2008 - 09:05 AM

So i've done a rework and 99% got it working.

The problem i now have is the layout is working in IE7 but not in FF2 the code i'm using is below.

Here is the HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{sitename}</title>

{stylesheet}
</head>

<body>
<!-- Start Wrapper for overall site -->
<div id="wrapper">

<!-- Start Header -->
<div id="header">
<img src="uploads/images/logo.jpg" /></div> 
<!-- End Header -->

<!-- Start Strip Div - For Your are here code -->
<div id="strip">
Your are here code
</div><!-- End strip Div -->


<!-- Start Container this is for glow image -->
<div id="container">

<!-- Start Menu Div -->
<div id="menu">
This will be the menu
</div><!-- End Menu Div -->

<!-- Start Content -->
<div id="content">
{content}
</div><!-- End Content Div -->

</div> <!-- End Container Div -->

<!-- Start Footer Div -->
<div id="footer">
{global_content name='footer'}
</div><!-- End Footer Div -->

</div> <!-- End wrapper for whole site -->


</body>
</html>


And here is the CSS

* {
padding: 0;
margin: 0;
}

body {
background: #FFFFCC;
}


#wrapper {
width: 944px;
margin: auto;
}


#header {
width: 944px;
height: 80px;
text-align: center;
background: #FFFFFF;
}


#strip {
width: 919px;
height: 35px;
padding-top: 25px;
padding-left: 25px;
background-image: url(uploads/background/top.jpg);
background-repeat: no-repeat;
background-position: top center;
}

#container {
width: 944px;
height: inherit;
background-image: url(uploads/background/filler.jpg);
background-repeat: repeat-y;
background-position: center;
}


#menu {
background: #FFFFFF;
margin-left: 25px;
width: 150px;
float: left;
}


#content {
background: #FFFFFF;
margin-left: 15px;
width: 730px;
float: left;
}

#footer {
padding-top: 15px;
clear: both;
width: 944px;
height: 70px;
text-align: center;
background-image: url(uploads/background/bottom.jpg);
background-repeat: no-repeat;
background-position: bottom center;
}

0

#14 User is offline   ElanMan 

  • In, out, shake it all about...
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 3,291
  • Joined: 11-March 08
  • Reputation: 53
  • Gender:Male
  • Location:Darlington
  • Experience:Nothing
  • Area of Expertise:Nothing

Posted 02 August 2008 - 09:14 AM

Neil, have you seen the example that I linked to above?
If you view the source code and css it has everything you need for the basic layout.
0

#15 User is offline   Neil Harding 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 112
  • Joined: 20-March 08
  • Reputation: 0
  • Location:Wales
  • Experience:Beginner
  • Area of Expertise:Coder

Posted 02 August 2008 - 10:14 AM

Hi ElanMan,

Yeah i did have a look but tried to see if i could get it working myself so i could understand what's going on.

I just don't get why my code works in IE but not in FF. I'll have another look at your code and see what happens.
0

#16 User is offline   k9ruby 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 248
  • Joined: 31-July 08
  • Reputation: 0
  • Experience:Intermediate
  • Area of Expertise:I'm Learning

Posted 02 August 2008 - 06:09 PM

Urrgh! I know!

I tested my IT coursework in firefox and IE. In FF it looked perfect but IE made it look scew whiff...
0

#17 User is offline   Sussex_Chris 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 153
  • Joined: 17-June 08
  • Reputation: 0
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Coder

Posted 04 August 2008 - 01:36 AM

I didn't realise there was a difference when designing my www.gimme4free.net website as I designed it in IE7.
Once the website was live I asked on this forum if people liked it and I was getting replies like it looks crap and I can't read the text, I then opened it in firefox and realised that it was completly buggered!!!

I think IE7 fixes CSS problems as it loads a page, I'm sure Ive been told that on this forum, check my posts and find the CSS help, there will be quite a few answers there.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users