|
|
Post a Project »
Find a Professional HTML Freelancer!
Find a Freelancer to help you with your HTML projects
| |
|
 |
|
|
08-07-2008, 09:52 PM
|
Help with website layout
|
Posts: 11
|
Hi
I like to make website layouts in photoshop, slice em up, add text, kaboom you have a website. However, I've always had problems with tables and their expansions...
Basically, I wanna create a site with a simple header, a navigation menu to the left, a main content box on the right and a footer on the bottom.
I can do this fine, the design etc, but when I go add more text to the content box than it can handle the whole page just splits up and looks terrible.. the images just break up everywhere
Basically I want the left menu and main content box to auto expand as I add more and more text, without messing the whole page. I've searched all over the net for something simple to follow but I thought that it was time I actually asked for help!
|
|
|
|
08-07-2008, 09:58 PM
|
Re: Help with website layout
|
Posts: 965
Name: John Irving
|
Well free coding I could explain how to do it but using photoshop to slice im not sure.
You would want a container div to hold everything. Inside there would be a header div which would just be the size of your header and contain it. Then you would have a table with each column set to valign="top". Then a footer div container containing the footer info and then close the container div.
__________________
Cheers, John Irving: My Blog
JLI Media: Please login or register to view this content. Registration is FREE | Website Development (Link Coming Soon!)
|
|
|
|
08-08-2008, 02:30 AM
|
Re: Help with website layout
|
Posts: 3
Name: Vesi
|
That is a Dreamweaver template and I think it's all right for your needs.
Code:
<!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>Your document title</title>
<style type="text/css">
<!--
body {
font: 100% Verdana, Arial, Helvetica, sans-serif;
background: #666666;
margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
padding: 0;
text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
color: #000000;
}
.twoColLiqLtHdr #container {
width: 80%; /* this will create a container 80% of the browser width */
background: #FFFFFF;
margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
border: 1px solid #000000;
text-align: left; /* this overrides the text-align: center on the body element. */
}
.twoColLiqLtHdr #header {
background: #DDDDDD;
padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
}
.twoColLiqLtHdr #header h1 {
margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
}
/* Tips for sidebar1:
1. since we are working in percentages, it's best not to use padding on the sidebar. It will be added to the width for standards compliant browsers creating an unknown actual width.
2. Space between the side of the div and the elements within it can be created by placing a left and right margin on those elements as seen in the ".twoColLiqLtHdr #sidebar1 p" rule.
3. Since Explorer calculates widths after the parent element is rendered, you may occasionally run into unexplained bugs with percentage-based columns. If you need more predictable results, you may choose to change to pixel sized columns.
*/
.twoColLiqLtHdr #sidebar1 {
float: left;
width: 24%; /* since this element is floated, a width must be given */
background: #EBEBEB; /* the background color will be displayed for the length of the content in the column, but no further */
padding: 15px 0; /* top and bottom padding create visual space within this div */
}
.twoColLiqLtHdr #sidebar1 h3, .twoColLiqLtHdr #sidebar1 p {
margin-left: 10px; /* the left and right margin should be given to every element that will be placed in the side columns */
margin-right: 10px;
}
/* Tips for mainContent:
1. the space between the mainContent and sidebar1 is created with the left margin on the mainContent div. No matter how much content the sidebar1 div contains, the column space will remain. You can remove this left margin if you want the #mainContent div's text to fill the #sidebar1 space when the content in #sidebar1 ends.
2. to avoid float drop at a supported minimum 800 x 600 resolution, elements within the mainContent div should be 430px or smaller (this includes images).
3. in the Internet Explorer Conditional Comment below, the zoom property is used to give the mainContent "hasLayout." This avoids several IE-specific bugs.
*/
.twoColLiqLtHdr #mainContent {
margin: 0 20px 0 26%; /* the right margin can be given in percentages or pixels. It creates the space down the right side of the page. */
}
.twoColLiqLtHdr #footer {
padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
background:#DDDDDD;
}
.twoColLiqLtHdr #footer p {
margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
}
/* Miscellaneous classes for reuse */
.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
float: right;
margin-left: 8px;
}
.fltlft { /* this class can be used to float an element left in your page */
float: left;
margin-right: 8px;
}
.clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
}
-->
</style><!--[if IE]>
<style type="text/css">
/* place css fixes for all versions of IE in this conditional comment */
.twoColLiqLtHdr #sidebar1 { padding-top: 30px; }
.twoColLiqLtHdr #mainContent { zoom: 1; padding-top: 15px; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]--></head>
<body class="twoColLiqLtHdr">
<div id="container">
<div id="header">
<h1>Header</h1>
<!-- end #header --></div>
<div id="sidebar1">
<h3>sidebar1 Content</h3>
<p>The background color on this div will only show for the length of the content. If you'd like a dividing line instead, place a border on the left side of the #mainContent div if the #mainContent div will always contain more content than the #sidebar1 div. </p>
<p>Donec eu mi sed turpis feugiat feugiat. Integer turpis arcu, pellentesque eget, cursus et, fermentum ut, sapien. Fusce metus mi, eleifend sollicitudin, molestie id, varius et, nibh. Donec nec libero.</p>
<!-- end #sidebar1 --></div>
<div id="mainContent">
<h1> Main Content </h1>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam, justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at, odio. Donec et ipsum et sapien vehicula nonummy. Suspendisse potenti. Fusce varius urna id quam. Sed neque mi, varius eget, tincidunt nec, suscipit id, libero. In eget purus. Vestibulum ut nisl. Donec eu mi sed turpis feugiat feugiat. Integer turpis arcu, pellentesque eget, cursus et, fermentum ut, sapien. Fusce metus mi, eleifend sollicitudin, molestie id, varius et, nibh. Donec nec libero.</p>
<h2>H2 level heading </h2>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam, justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at, odio.</p>
<!-- end #mainContent --></div>
<!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --><br class="clearfloat" />
<div id="footer">
<p>Footer</p>
<!-- end #footer --></div>
<!-- end #container --></div>
</body>
</html>
Last edited by killerqueen; 08-08-2008 at 02:31 AM..
Reason: forgot something
|
|
|
|
08-08-2008, 07:14 AM
|
Re: Help with website layout
|
Posts: 11
|
hmm yes I can see how that template would work. How would I go about putting my own images in the background? E.G nice sidebars, a nice header, footer etc.
Basically I have this nice layout made on photoshop, nice graphics and all. I slice it up where I want to add things etc. When I add more text to my content box the layout splits apart. Is there any way I can have both the main content and side navigation auto expand as I add more text?
Last edited by daniel101; 08-08-2008 at 07:17 AM..
|
|
|
|
08-08-2008, 10:16 AM
|
Re: Help with website layout
|
Posts: 10,017
Location: Tennessee
|
The first thing you need to learn is CSS and get AWAY from using tables for your web site layout. You also shouldn't be using Photoshop's exported html, it's a hideous mess.
To change out the graphics, change the background image rules in the CSS that was posted. Some images could go into the html directly, depends on what they're for.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
Please login or register to view this content. Registration is FREE
Please login or register to view this content. Registration is FREE
|
|
|
|
08-08-2008, 01:13 PM
|
Re: Help with website layout
|
Posts: 6
Name: joel
|
Just design the site in Photoshop how you want it in HTML. Then go to save as - and export all images and HTML. Then adjust it in dreamweaver. Make sure everything matches up horizontally - basically make sure you don't have a bunch of weird shaped slices, try to keep everything in as few columns and rows as possible.
Joel McLaughlin
<removed>
Last edited by chrishirst; 08-18-2008 at 04:20 AM..
|
|
|
|
08-08-2008, 03:05 PM
|
Re: Help with website layout
|
Posts: 10,017
Location: Tennessee
|
Quote:
|
Then go to save as - and export all images and HTML
|
Exactly what I said should NOT be done because of the horrid code it produces. 
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
Please login or register to view this content. Registration is FREE
Please login or register to view this content. Registration is FREE
|
|
|
|
08-08-2008, 05:25 PM
|
Re: Help with website layout
|
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
|
Photoshop is a wonderful, amazing product, the best in the world for what it does. But it should never be used for exporting HTML.
__________________
I build web things. I work for the startup Please login or register to view this content. Registration is FREE
.
|
|
|
|
08-10-2008, 12:51 PM
|
Re: Help with website layout
|
Posts: 322
|
If you dont want to take the time to learn how to make a site using css and html just search google and you can find TONS of premade templates where the HTML and CSS are done for you and then you can swap out the images with the ones you have created. It wont be perfect but it will save you the work of learning to code if you dont want to.
__________________
DVD Movie Release Database: Please login or register to view this content. Registration is FREE
|
|
|
|
08-18-2008, 04:18 AM
|
Re: Help with website layout
|
Posts: 47
Name: Katie
|
I agree if you have the time to learn css, this is an easy design to create and would be better code in css. However if you don't have the time then a template is probably the way to go.
|
|
|
|
|
« Reply to Help with website layout
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|