473,395 Members | 1,692 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,395 software developers and data experts.

div tag and layout

Hello i am new to the site and registered cause it looks like i can get the help i need here. So the help i need besides mental help is a problem with getting so things to align for me properly.

Here you can see what i mean. The Site in question

The problem i am having is in the bottom area where the 3 windows are verticaly aligned when they should be aligned horizontaly. Now i have trying useing absolute and relative positioning and that didn't work. Absolute won't work cause it works off the left margin and screws up when the window is resized. Relative worked but left a space where each div was in it's vertical position. So there was a huge blank area that i can't fill or get rid off.

Now normaly i would lay all this out with tables but sense i know things have changed and the people who make the browsers can't seem to come up with any full standard. I did it with the div tag so it might look alittle sloppy and or novice like. If you guys could help me out that would be awesome.

-Charles
Jun 11 '07 #1
9 2837
Now i am having a padding issue. Now this works fine in IE but for FF i don't know what the heck it's doing. If i add another <div> tag around the text in the main area and give it a padding-right value it works. In IE it works when i get the parrent <div> the padding-right value.
Jun 11 '07 #2
drhowarddrfine
7,435 Expert 4TB
The problem is IE and the fact that you are designing in IE and then checking in Firefox which is the opposite of what you should be doing.

1) You will never get IE to pretend to act like a modern browser without a proper doctype. See the article about this under "Article" above.
2) You are using an 'id' name more than once in your css. id names can only be used once per page.
3) There must be 'units' for dimensions, ie, you must specify px, em, etc.
4) Internet Explorer is old, buggy and non-standard. Always test your code in a modern browser, such as Firefox or Opera, and then adjust for IEs quirks and bugs.

Validating your html and css would have shown you these errors.
Jun 11 '07 #3
I was testing it in firefox. I only opened it in IE to see how it would look for the common public. And i saw that it was working there. I will check out the article about the DOC types. And how dose one validate there code. Thanks for the help so far.

EDIT: So found the article on DOC types and on Validating and i am working on cleaning up my mark up. Can someone now help me with the problem of the divs stacking like they are.
Jun 11 '07 #4
Ok so now that i have it all cleaned up and using valid markup and i have 1 error in my css that i am not to worried about. My site is all goffy looking i have yet to start messing with reworking the CSS and HTML to try and make it look like it's supose to again because i have to head off to work. If anyone wants to help me on figureing out why it's now doing what it's doing that would be awesome :)
Jun 11 '07 #5
drhowarddrfine
7,435 Expert 4TB
First, you are using xhtml closing tags, the />. Remove the slash from all ending tags that have that.

EDIT: Then, add float:left to .window in your css. You may have to adjust the width of the divs to get them to fit in one line.
Jun 11 '07 #6
Thanks for the help with getting all the doc type set up and getting the lower windows to line up. I will have to play with the widths like you said to make them line up right but that i can do.

The problem now is that the nav bar has a space between the header and the header has a space between the main content and the main content has a space between the top of the windows. I am not sure what is causing this at all. I will sit and play with it some more to see if i can't get it figured out.
Jun 12 '07 #7
Ok i can't for the life of me figure out what is going on with this layout. IE is displaying really nice and FF is now the on that can't seem to figure out what to do. Now i always design using FF and check with IE just to make any tweaks needed. But this one is really messing with my head. I know why the lower windows don't line up perfectly in ie. That is because the images are just a little big to make them space evenly. But that doesn't explain what FF is doing with the windows and the rest of the images.
Jun 13 '07 #8
drhowarddrfine
7,435 Expert 4TB
You need to be more specific because what I see is the opposite of what you describe. The windows at the bottom may be different due to default margins and padding which are different between browsers. Many times, we set all margins and padding to zero in css just to keep everyone on the same page, then set them as we like.
Jun 13 '07 #9
use this 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=iso-8859-1" />
<style>
body{
background: #000000;
color: #808080;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
margin: 0px;
padding: 0px;
text-align: center;
}
a{ color:#fffffF; text-decoration:none;}
img{border: 0px;}

#wrapper{ margin:0px auto; width: 820px;
}
#navbar{
background: transparent url(images/navbar.gif);
background-repeat: repeat-x;
height: 15px;
text-align: right;
padding-right: 14px;
}
.header{background-image:url(images/header.gif); background-repeat:no-repeat; height:100px;}
#lower_header{ background: transparent url(images/lower_header.gif); background-repeat: repeat-x;height:30px;}
#lower_header span.lft{background-image:url(images/lower_header_left.gif); width:36px; height:30px; background-repeat:no-repeat; float:left}
#lower_header span.rgt{background-image:url(images/lower_header_right.gif); width:36px; height:30px; background-repeat:no-repeat; float:right}
#main_content{
background: transparent url(images/site_bg.gif);
background-repeat: repeat-y;
text-align: left;
font-weight: bold;
padding-left:30px;
}
#mid_divider{background-image:url(images/mid_bg.gif);background-repeat: repeat-x;height: 9px;}
#mid_divider span.lft{background-image:url(images/mid_left.gif); background-repeat:no-repeat; width:23px; height:9px; float:left; line-height:9px; font-size:1px;}
#mid_divider span.rgt{background-image:url(images/mid_right.gif); background-repeat:no-repeat; width:23px; height:9px; float:right;line-height:9px; font-size:1px;}
.window{background-image:url(images/window_tile.gif);background-repeat: repeat-x;height: 183px;color: #808080;width: 273px;float:left;}
.window span.lft{background-image:url(images/window_left.gif); width:23px; height:183px; background-repeat:no-repeat; background-position:bottom; float:left;}
.window span.rgt{background-image:url(images/window_right.gif); width:23px; height:183px; background-repeat:no-repeat; background-position:bottom; float:right;}
.window span.txt{ padding:10px; text-align:left; float:left; color:#ffffff}

</style>
<title>Untitled Document</title>
</head>

<body>
<div id="wrapper">
<div id="navbar"><a href="#">sdfs</a></div>
<div class="header"></div>
<div id="lower_header">
<span class="lft"></span>
<span class="rgt"></span>
</div>
<div id="main_content">Welcome to the The Infamous Flaming Vagabonds website. It is currently underconstruction as you can see but you would like you to join us on our forums.<br>The address to our forums is <a href="http://forums.ifvguild.com">http://forums.ifvguild.com</a><br /><br /><br /></div>
<div id="mid_divider">
<span class="lft"></span>
<span class="rgt"></span>
</div>
<div class="window">
<span class="lft"></span>
<span class="rgt"></span>
<span class="txt">Test</span>
</div>
<div class="window">
<span class="lft"></span>
<span class="rgt"></span>
<span class="txt">Test</span>
</div>
<div class="window">
<span class="lft"></span>
<span class="rgt"></span>
<span class="txt">Test</span>
</div>
</div>
</body>
</html>
Jun 14 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

82
by: Peter Diedrich | last post by:
The site design is pretty simple: ============================================ | Head | ============================================ | | ...
39
by: Zak McGregor | last post by:
Hi all Are there any good solutions to aligning form field names and input boxes without resorting to tables? I am struggling to do this nicely at the moment. Thanks Ciao Zak
47
by: Neal | last post by:
Patrick Griffiths weighs in on the CSS vs table layout debate in his blog entry "Tables my ass" - http://www.htmldog.com/ptg/archives/000049.php . A quite good article.
20
by: Tammy | last post by:
What would be a good alternative to using frames? I need something that will section my webpage into two halves and can change both frames on a single click. Thanks in Advance, Tammy
10
by: Volker Lenhardt | last post by:
For a QApplication (PyQt) on the small screen of my Zaurus 5500 PDA I try to layout my data output in a QScrollView as the central widget. I'd prefer to use QGridLayout, but cannot add it to the...
10
by: Luke | last post by:
Hi. I am trying to make correct layout, here is an example of (dynamically generated content via jsp): http://localhost/www/layout.htm Most outer div is positioned absolute (if not then it...
3
by: Samuel Shulman | last post by:
I am looking for good guidance for positioning controls on the form.document, it is absolute nightmare and I don't know where to begin Thank you, Samuel Shulman
5
by: Jeff User | last post by:
Hi all I am writing program/framework to server a web site dynamically based on stored web page data with C#, .net1.1 What is the preferred means of controlling page layout, frames or...
5
by: Ed Sproull [MSFT] | last post by:
First I'm pretty new to ASP.NET and I'm having a simple problem. I have small website with a header, sidebar and the the content. I want my content to appear beside my sidebar which seems to be a...
53
by: brave1979 | last post by:
Please check out my javascript library that allows you to create any layout for your web page, nested as deep as you like, adjusting to width and height of a browser window. You just describe it in...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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
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.