473,413 Members | 2,066 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Page layout using DIVs and CSS

Hi

I am looking to convert a site from HTML to ASP.NET making use of CSS. I
have tried various combinations but I can not seem to get the correct
combination of div and CSS tag configurations.

I have uploaded a screenshot (http://www.bwbfc.com/math/regions.jpg) of how
the screen will be laid out. Firstly it is all cantered in the window. I
plan to create a master page which would contain the header (in blue), the
footer (in yellow) and the menu (in green). I would then have a content
place holder for the body of the page (in red).

Ideally I would like to get this pixel perfect; I have the dimensions for
everything. The two most important ones are the total size which should
ideally be 830 x 511 px, and the body div which should be 664 x 328 px.
Following on from this, each page would be responsible for rendering divs
(with thick border containing images) within the content place holder.
In the above screenshot, we are rendering 2x4 cells. Other configurations
may be 4x2, 4x1 or 8x1.

I have also uploaded another screenshot
(http://www.bwbfc.com/math/dimensions.jpg) which details the dimensions for
all the divs on the page.

So my question is, what would be the best approach to achieve this layout?
I tried creating a div to contain everything and then having separate div
within this but it all started to get a bit messy. Another aspect I was
struggling with was getting it all to sit centrally on the page.

Anyway, it would be good if someone could shed some light on the best
approach for using divs and css.

Kind regards, Carl Gilbert
Feb 9 '07 #1
3 1811
I don't see a problem "researching" one of the many CSS templates [1]
websites.

--
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
MAP http://wikimapia.org/#y=43038073&x=-...8&z=17&l=0&m=h

[1] http://intensivstation.ch/templates/
"Carl Gilbert" <mr*************@hotmail.comwrote in message
news:ug****************@TK2MSFTNGP04.phx.gbl...
Hi

I am looking to convert a site from HTML to ASP.NET making use of CSS. I
have tried various combinations but I can not seem to get the correct
combination of div and CSS tag configurations.

I have uploaded a screenshot (http://www.bwbfc.com/math/regions.jpg) of
how the screen will be laid out. Firstly it is all cantered in the
window. I plan to create a master page which would contain the header (in
blue), the footer (in yellow) and the menu (in green). I would then have
a content place holder for the body of the page (in red).

Ideally I would like to get this pixel perfect; I have the dimensions for
everything. The two most important ones are the total size which should
ideally be 830 x 511 px, and the body div which should be 664 x 328 px.
Following on from this, each page would be responsible for rendering divs
(with thick border containing images) within the content place holder.
In the above screenshot, we are rendering 2x4 cells. Other configurations
may be 4x2, 4x1 or 8x1.

I have also uploaded another screenshot
(http://www.bwbfc.com/math/dimensions.jpg) which details the dimensions
for all the divs on the page.

So my question is, what would be the best approach to achieve this layout?
I tried creating a div to contain everything and then having separate div
within this but it all started to get a bit messy. Another aspect I was
struggling with was getting it all to sit centrally on the page.

Anyway, it would be good if someone could shed some light on the best
approach for using divs and css.

Kind regards, Carl Gilbert

Feb 9 '07 #2
Carl Gilbert wrote:
Hi

I am looking to convert a site from HTML to ASP.NET making use of CSS. I
have tried various combinations but I can not seem to get the correct
combination of div and CSS tag configurations.

I have uploaded a screenshot (http://www.bwbfc.com/math/regions.jpg) of how
the screen will be laid out. Firstly it is all cantered in the window. I
plan to create a master page which would contain the header (in blue), the
footer (in yellow) and the menu (in green). I would then have a content
place holder for the body of the page (in red).

Ideally I would like to get this pixel perfect; I have the dimensions for
everything. The two most important ones are the total size which should
ideally be 830 x 511 px, and the body div which should be 664 x 328 px.
Following on from this, each page would be responsible for rendering divs
(with thick border containing images) within the content place holder.
In the above screenshot, we are rendering 2x4 cells. Other configurations
may be 4x2, 4x1 or 8x1.

I have also uploaded another screenshot
(http://www.bwbfc.com/math/dimensions.jpg) which details the dimensions for
all the divs on the page.

So my question is, what would be the best approach to achieve this layout?
I tried creating a div to contain everything and then having separate div
within this but it all started to get a bit messy. Another aspect I was
struggling with was getting it all to sit centrally on the page.

Anyway, it would be good if someone could shed some light on the best
approach for using divs and css.

Kind regards, Carl Gilbert

When you write the html code of the page, don't think so much of the
layout. Think more of the information that the page contains. If the
layout is good, it will more or less be divided into the same elements
as the information.

The content of the body tag shouldn't have to be much more complex than
this:

<div class="Page">
<div class="Top">
<div class="Logo"><img ... /></div>
<div class="Slogan">site slogan</div>
</div>
<div class="Menu">
<a href="..." ...>...</a>
<a href="..." ...>...</a>
<a href="..." ...>...</a>
<a href="..." ...>...</a>
</div>
<div class="Main">
<div class="ImageContainer"><img ... /></div>
<div class="ImageContainer"><img ... /></div>
<div class="ImageContainer"><img ... /></div>
</div>
<div class="Footer">
<a href="..." ...>1</a>
<a href="..." ...>2</a>
<a href="..." ...>3</a>
</div>
</div>

Now you can just place the elements using css.

--
Göran Andersson
_____
http://www.guffa.com
Feb 10 '07 #3
Thanks for your help. That seems to be working very well indeed.
I've always been a bit sceptical of CSS as I prefer coding to design but
when I consider how my html looked when I was using tables to perform the
layout CSS wins hands down.

Cheers, Carl
>
When you write the html code of the page, don't think so much of the
layout. Think more of the information that the page contains. If the
layout is good, it will more or less be divided into the same elements as
the information.

The content of the body tag shouldn't have to be much more complex than
this:

<div class="Page">
<div class="Top">
<div class="Logo"><img ... /></div>
<div class="Slogan">site slogan</div>
</div>
<div class="Menu">
<a href="..." ...>...</a>
<a href="..." ...>...</a>
<a href="..." ...>...</a>
<a href="..." ...>...</a>
</div>
<div class="Main">
<div class="ImageContainer"><img ... /></div>
<div class="ImageContainer"><img ... /></div>
<div class="ImageContainer"><img ... /></div>
</div>
<div class="Footer">
<a href="..." ...>1</a>
<a href="..." ...>2</a>
<a href="..." ...>3</a>
</div>
</div>

Now you can just place the elements using css.

--
Göran Andersson
_____
http://www.guffa.com

Feb 12 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Anders Wegge Jakobsen | last post by:
Hi, I'm playing around with a layout for a weblog. A mockup can be seen at <http://outside.bakkelygaard.dk/~wegge/testblog/index.html>. The page has a fixed width of 800px, so I'm perfectly...
30
by: Diane Wilson | last post by:
I'm trying (once again) to figure out how to make a robust CSS layout style that can replace tables. I'd like to be able to do a basic two-column layout, with a one-column header, a two column...
0
by: Chris Lieb | last post by:
I am working on redesigning my site, but am having trouble getting the basic layout to render the way I envision it. I am trying to get a layout that is shaped like a U turned so the open end is...
14
by: Anoop | last post by:
Hi, I am new to this newsgroup and need help in the following questions. 1. I am workin' on a GUI application. Does C# provides Layout Managers the way Java does to design GUI? I know that it...
3
by: Vai2000 | last post by:
Hi All, I am coming from old school web-design so prefer table layout. I see people using div just everywhere...? Why aren't they using tables? which is better? esp. when u have objects custom...
1
by: adventurer | last post by:
Is it possible to float left a few div elements so they stack left to right, but then have each "column" expand to the SAME length as the longest column? I am trying to make a border around a box...
7
by: cmcdermo | last post by:
Hopefully this is an easy solution. I come from the old school tables layout. I am trying to accomplish a layout using divs that I can easily do in tables but having trouble with using divs. ...
18
by: maya | last post by:
pls look @ this pg, http://www.mayacove.com/design/divs.html in IE and FF.. in IE it looks fine, but in FF the main div (centered, 800px wide, blue background; in reality the bg will be white..)...
5
by: Timothy Larson | last post by:
I'm trying to create a 3 row layout in which each row will have two blocks, BUT I want the width of these blocks to be independent of the blocks in the other rows. So AFAICT a regular table layout...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.