Moving from Tables

This is a discussion on "Moving from Tables" within the Web Page Design section. This forum, and the thread "Moving from Tables are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Mar 9th, 2008, 18:48
Junior Member
Join Date: Jan 2008
Location: UK
Age: 29
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Moving from Tables

OK i'm a table junkie as every time i try CSS the different browsers cause me so much pain i always go back to tables.

But i'm not going to this time, i'm going to get my head around CSS.


But i have a problem

This is the new CSS page: http://dev.hobbit-hosting.com

what i need is to get the bottom of the div to align with the context div.

the page should look like http://dev.c4media.co.uk when i finish the other bits (this one has a table type template with a bit CSS.)


Any tips on getting this to work?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Mar 9th, 2008, 22:00
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,186
Blog Entries: 7
Thanks: 27
Thanked 23 Times in 20 Posts
Re: Moving from Tables

Here's some tips for writing cross browser code:-

Reset all elements margins, paddings and text-size's in your css - this is because different browsers use different defaults - be sure to add the following code to the beginning of your css file.

Code: Select all
* {margin:0; padding:0; text-size:12px;}
This means you have to explicitly define margins and paddings on everything that needs them, and specify font-size's for all elements using em units.

My last tip is to never design for internet explorer. Design for firefox, and then fix the bugs in IE.... never the other way round - most people who have massive cross browser headaches dont do this.

The above will make your life twenty times easier.
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Mar 10th, 2008, 07:13
Junior Member
Join Date: Jan 2008
Location: UK
Age: 29
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Moving from Tables

Thanks for the Firefox tip. I tend to use Dreamweaver to do the sites and find what i see there is what firefox will look like.

I do tend to put the margin and padding at the begining, but i tend to put it in the body, should i move it to *?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Mar 10th, 2008, 07:20
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,186
Blog Entries: 7
Thanks: 27
Thanked 23 Times in 20 Posts
Re: Moving from Tables

definitly use *.... this will apply to ALL elements and basically reset their defaults. You then need to set these up where needed because nothing will have padding or margin anymore by default.

Doing it this way, and explicitily defining them tends to remove a lot of issues spacing, positioning and text sizing issues across browsers.
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Mar 18th, 2008, 19:23
Junior Member
Join Date: Jan 2008
Location: UK
Age: 29
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Moving from Tables

Right i've been having a play and there's a few things i just can't get working.
http://dev.hobbit-hosting.com

1) The Menu on the left. The white border should go around the whole button but for some reason the green background pops out on the left a bit.

2) The left Div (menu div) the bottom doesn't match up with the context.

Here is the code.

CSS

PHP: Select all

* { padding0margin0; }
body {
 
font-familyArialHelveticasans-serif;
 
font-size14px;
}
#wrapper { 
 
margin0 auto;
 
width980px;
}
#header {
background-imageurl(images/css/background.gif);
width980px;
height144px;
}
#headertitle {
background-image:url(images/css/background-02.gif);
width980px;
height44px;
float:left;
}
#left {
background-image:url(images/css/background-03.gif);
background-repeatrepeat;
width235px;
heightauto;
floatleft;
text-aligncenter;
font-size16px;
font-weightbold;
}
#leftcontext {
padding-left15px;
padding-right10px;
padding-top10px;
padding-bottom15px;
width470px;
background-color:#999999;
floatleft;
}
#rightconext {
width250px;
background-color#00FF00;
floatright;
}
#footer {
clearboth;
background-imageurl(images/css/background-05.gif);
width980px;
height:48px;
}
#navlist 
{
text-alignleft;
list-
stylenone;
padding0;
margin0 auto;
width70%;
}
#navlist li
{
displayblock;
margin0;
padding0;
bordersolid .25em #FFFFFF;
margin-top0.3em;
margin-bottom.7em;
}
#navlist li a
{
text-aligncenter;
displayblock;
width100%;
padding.3em;
color#FFFFFF;
text-decorationnone;
background#3d736b;
}
ul {
margin-left15px;
}
img {
padding-top10px;
padding-bottom5px;
}
#logo {
margin-left25px;

HTML

PHP: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<
title>Pentre Bach Home Page</title>
<
link rel="stylesheet" type="text/csshref="main.css/>
</
head>
<
body>
<
div id="wrapper">
<
div id="header"><img id="logo" src="images/logo2.gifalt="logo" width="290" height="113" /></div>
<
div id="headertitle"></div>
<
div id="left">
    <
ul id="navlist">
    <
li><a href="index.php">HOME</a></li>           
    <
li><a href="thecottages.html">THE COTTAGES</a></li>
    <
li><a href="thearea.html">THE AREA</a></li>
    <
li><a href="booking.html">BOOKING</a></li>
    <
li><a href="gallery.html">GALLERY</a></li>
    <
li><a href="comments.html">COMMENTS</a></li>
    <
li><a href="links.html">LINKS</a></li>
    <
li><a href="contacts.html">CONTACT US</a></li>
</
ul></div>
 
<
div id="leftcontext">
  <
p>Pentre Bach House and its three cottages are set in three acres of land overlooking Cardigan Baywith dramatic Cader Idris and     its fellow mountains outside the back door. </p>
  <
p>&nbsp;</p>
  <
p>This is a great place for spending the days inhaling lungfuls of briny air on the beachclimbing hills and playing games in the     great outdoorsfollowed by evenings around the supper table and in front of the fire with books and filmsThere's a large field     for games, a willow den for the children and a table tennis room. </p>
  <p>&nbsp;</p>
  <p>The nearest beach, ten minutes' 
walk awayis pebbly, and there are two excellent sandy beaches within a 15 minutes drive in     either direction.</p>
  <
p>&nbsp;</p>
    <
ul>
    <
li>Where mountains meet the sea in beautiful Snowdonia</li>
    <
li>Can accommodate from two up to thirty people</li>
    <
li>Wide range of outdoor activities on the doorstep</li>
    <
li>Open fires in three properties </li>
    <
li>Action packed week or romantic short break</li>
    <
li>Relax and enjoy seclusion without isolation </li>
    <
li>Nearest traffic lights 40miles away but we are only 2-3 hours from Birmingham and Manchester.</li>
    </
ul>
</
div>
<
div id="rightconext">
<
img src="images/pb_PICTURE.jpg" alt="pbhouse" width="250" height="178" />
<
img src="images/outsidepb.jpg" alt="outsidepb" />
<
img src="images/villagefromhill.jpg" alt="view from hill" />
  </
div>
<
div id="footer"></div>
 
 <!-- 
End Wrapper and body -->
</
div></body>
</
html
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Mar 18th, 2008, 20:50
Junior Member
Join Date: Feb 2008
Location: Michigan
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Moving from Tables

If you haven't already, i'd recommend installing firebug (firefox extension) and then using that to debug your css - makes life tons easier.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Mar 19th, 2008, 07:36
Junior Member
Join Date: Jan 2008
Location: UK
Age: 29
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Moving from Tables

I've downloaded that but can't see why the div is not working correctly
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Mar 21st, 2008, 13:57
Junior Member
Join Date: Feb 2008
Location: Michigan
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Moving from Tables

In firebug, I was able to fix the white border not going around the left side nav items by editing #navlist li a - removing width: 100% - I think that that was pushing the width of the A items such that with the padding they were larger than the containing LI element....

You can fix the gap beneath the nav items by adding url(images/css/background-03.gif) to the div#wrapper and setting it to top left, repeat-y so it tiles down the left side and shows beneath all the other elements.

Hope that helps!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving Nav bar acrikey Web Page Design 5 Sep 26th, 2007 13:37
Moving Ryan Fait Webforumz Cafe 36 Jun 12th, 2007 22:55
Images moving notagz1 Web Page Design 5 May 22nd, 2007 03:04


All times are GMT. The time now is 12:19.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42