Web Design Forum: CSS Web layout - 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 Web layout New to the forums, help please!

#1 User is offline   THRASHx 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 13
  • Joined: 26-January 10
  • Reputation: 0

Posted 26 January 2010 - 08:38 PM

Hey guys,
Basically im creating a website and I know how outdated tables are for content, so I decided to create a little mock-up in Illustrator, slice and then export and import into Dreamweaver. This was all good, im not very familiar with CSS although I am more familiar now then when I started the project.
But anyway, I deleted the gifs it created in the layout and applied to stylesheets, etc. I then carried on with the design and I had a number of good looking pages which I was very happy with.
That was until I took a closer look at the code, for some strange reason I had my CSS layout and a table layout, I dont really know how to explain, I was certain it was CSS but in the code theres definitely tables and if I make the border 1px you can see the border of this table where my CSS layout should be, because of this im getting huge gaps between the header, body and footer.

If someone could help me id appreciate it.

Heres an example of what I mean:
<div id="layout">
  <!-- ImageReady Slices (Untitled-1.html) -->
  <div style="position:absolute; left:0px; top:0px; width:1024px; height:1024px; font-family: Verdana, Geneva, sans-serif; color: #FFF;">
    <table id="Table_01" width="1024" height="979" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="318" rowspan="2" align="left" valign="top">&nbsp;</td>
        <td width="706" height="201" align="left" valign="middle"><div id="header">
          <p align="left"><img src="images/City Tourism Vector2.png" width="88" height="79" alt="CityTourismLogo"><img src="images/CityTourism1.png" width="120" height="29" alt="CityTourism"></p>
          <p><FONT size="1">- Tourist information for the City</FONT></p>
          <p>&nbsp;        </p>
        </div></td>
      </tr>


Thank you
0

#2 User is offline   Lev 

  • -'-
  • PipPipPipPipPip
  • Group: Members
  • Posts: 3,946
  • Joined: 28-October 09
  • Reputation: 257
  • Gender:Male
  • Location:Russia
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 27 January 2010 - 06:24 AM

What kinda help, mate?

Try this: Open your file in DW -> Modify -> Convert -> Tables to layers...

But I'm not sure that the result will be satisfactory. Most likely, it will be impossible to do without hand coding.
0

#3 User is online   Dizi 

  • Queen of the Spammers
  • PipPipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 5,639
  • Joined: 13-August 07
  • Reputation: 156
  • Gender:Female
  • Location:Newcastle, UK
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 27 January 2010 - 06:52 AM

If you are wanting to use css because you have heard that it is better for SEO or better for accessibility compared to tables you are very right it is.

However the reason that using CSS is seen as better is because it takes all the styling information (colours, font information, widths, heights) out of the html code making it cleaner and easier to read for browsers, spiders and screen readers a like.

Slicing the code within a graphics editor, be it fireworks, photoshop, illustrator or whatever, creates a whole pile of pointless coding and takes away the whole reason for using CSS over tables in the first place.

So the best help that anyone can give you, is for them to stand on their high horse and tell you that if it matters how your code looks then, learn how to code yourself rather than relying on something to make the code for you, that way you will have control over what goes into it and what stays out.

Here is a nice tutorial that takes a psd through the steps of being coded, it would be pretty much the same for any graphics editor to html:
http://net.tutsplus....s-step-by-step/
0

#4 User is offline   Lev 

  • -'-
  • PipPipPipPipPip
  • Group: Members
  • Posts: 3,946
  • Joined: 28-October 09
  • Reputation: 257
  • Gender:Male
  • Location:Russia
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 27 January 2010 - 07:00 AM

Tip of the hour:):

Dreamweaver -> File -> New...
Try to play with page templates, to analyze generated code.
0

#5 User is offline   empek 

  • Wordpress Geek
  • PipPipPipPip
  • Group: Members
  • Posts: 774
  • Joined: 17-December 08
  • Reputation: 75
  • Gender:Male
  • Location:New York City.
  • Experience:Web Guru
  • Area of Expertise:Designer/Coder

Posted 27 January 2010 - 07:20 AM

Haha, right on point Lev, and Dizi, as usual! ;)
0

#6 User is offline   THRASHx 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 13
  • Joined: 26-January 10
  • Reputation: 0

Posted 27 January 2010 - 12:00 PM

Thanks for all the help.

Yesterday I did have a look at the templates in Dreamweaver and managed to adapt them to suit the layout I want.

However, I was wondering what the difference is between a liquid layout and an elastic layout, I know about liquid layouts and I chose to use a liquid template, but what about elastic?

Thanks, as I said before, a complete n00b to CSS and havent even done a website in a while :blush1:
0

#7 User is offline   Lev 

  • -'-
  • PipPipPipPipPip
  • Group: Members
  • Posts: 3,946
  • Joined: 28-October 09
  • Reputation: 257
  • Gender:Male
  • Location:Russia
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 27 January 2010 - 12:10 PM

Liquid, elastic. Flexible also.
As for me, it makes no difference.
0

#8 User is offline   THRASHx 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 13
  • Joined: 26-January 10
  • Reputation: 0

Posted 27 January 2010 - 02:31 PM

Im trying to create the following layout but I just dont know enough about creating layouts to actually do it :/

Posted Image

Id appreciate it if someone could help me.

Thanks
0

#9 User is offline   pippin62 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 211
  • Joined: 21-July 08
  • Reputation: 3
  • Experience:Intermediate
  • Area of Expertise:Designer

Posted 29 January 2010 - 03:57 PM

View PostTHRASHx, on 27 January 2010 - 02:31 PM, said:

Im trying to create the following layout but I just dont know enough about creating layouts to actually do it :/

Posted Image

Id appreciate it if someone could help me.

Thanks


I'm afraid you haven't had a reply because there's not short-cut way to do it other than to learn. Most of the members on these forums have already put a lot of time and effort in becoming so proficient. I'd recommend putting a bit of effort into going through one of the many CSS tutorials available either on-line or in book format. Once you get going it's actually enjoyable!
0

#10 User is offline   Wickham 

  • Web Guru
  • View gallery
  • Group: Moderators
  • Posts: 2,682
  • Joined: 11-June 09
  • Reputation: 233
  • Gender:Male
  • Location:Salisbury UK
  • Experience:Intermediate
  • Area of Expertise:Web Developer

Posted 29 January 2010 - 04:25 PM

Here you go, just copy/paste it all without editing, then adjust the widths and heights if you want. My code validates (check your code here http://validator.w3.org/ )

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"        
"http://www.w3.org/TR/html4/strict.dtd"> 

<html>
<head>
<title>Test Page</title>
<meta http-equiv="content-type" content="text/html;  charset=utf-8">
<style type="text/css">
body { margin: 0; }
div { padding: 5px; margin: 0; }
#wrap { width: 1000px; margin: 0 auto; position: relative; padding: 0; }
#header-left { width: 187px; float: left; border-right: 3px solid #000; 
height: 150px; }
#header-right { width: 790px; float: right; height: 150px; background: 
#ccc; }
.clear { clear: both; width: 100%; height: 0; visibility: hidden; padding: 0; 
}
#nav { width: 187px; float: left; border: solid #000; border-width: 3px 3px 
3px 0;  height: 350px; background: #ccc; }
#content {  width: 790px; float: left; border: solid #000; border-width: 3px 
0 3px 0; height: 350px; }
#subnav { width: 790px; border-bottom: 3px solid #000; height: 70px; 
background: #ccc; margin: -5px 0 0 -5px; }
#footer-left { width: 187px; float: left; border-right: 3px solid #000; height: 
150px; }
#footer-right { width: 790px; float: right; height: 150px; background: 
#ccc; }
p { margin: 0; }
</style>
</head>
<body>

<div id="wrap">
<div id="header-left"><p>&nbsp</p></div>
<div id="header-right"><p>Header</p></div>
<div class="clear">&nbsp;</div>
<div id="nav"><p>Navigation</p></div>
<div id="content">
<div id="subnav"><p>Sub-navigation</p></div>
<p>Body</p>
</div>
<div class="clear">&nbsp;</div>
<div id="footer-left"><p>&nbsp</p></div>
<div id="footer-right"><p>Footer</p></div>

</div><!--end of #wrap-->

</body>
</html>


It looks like this:-
http://www.wickham43...sh100129-2.html

Remember that padding and borders need to be added to a div width if you edit widths. The left side of my page is 200px being 187 + 3px right border + 2*5px padding = 200px

The right side is 790 + 2*5px padding = 800px.
1

#11 User is offline   THRASHx 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 13
  • Joined: 26-January 10
  • Reputation: 0

Posted 09 February 2010 - 02:02 PM

Thats brilliant, thanks a lot for the help!

EDIT - When putting more content into the divs, for example the nav div, it expands into the body div which I was having problems with before. I was wondering if someone could tell me how to stop that from happening?
Its part of a website im doing about accessible websites so it would be quite ironic if the text size couldnt increase without it distorting the whole website.
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