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

Positioning DIV's relative to each other

Hello,

I'm rewriting our corporate website, and to make editing the format
later I want to rewrite it completely using CSS with no table tags.
I've used CSS for years, but never exclusively, so I'm having some
problem converting some of the Table tags into CSS.

My first hurdle is we have a table with three TD's and I don't know
how to mimic this in CSS. Here's the code:

<TABLE cellSpacing=0 cellPadding=0 width=740 bgColor=#000000 border=0>
<TBODY>
<TR>
<TD width=140><IMG height=38 alt=search src="earch1.gif"
width=140></TD>
<TD vAlign=center align=left width=116><INPUT size=18
name=searchtext></TD>
<TD width=78><INPUT type=image src="search_go.gif"></TD>
<TD width=406><A href="submit.cfm"><IMG height=38
src="nursery.jpg" width=406 border=0></A></TD>
</TR>
</TBODY>
</TABLE>

If I were to create the following DIV's, how do I make them show-up
side by side? Also note, our page is centered on the screen, so I
need to direct it where to put it I guess based on the heading DIV,
which is DIV#Heading{ top: 0px; width: 740px; height: 191px;}. I
have the page centered with Body{text-align: center;}.

Div#Section1 {
width: 140px;
height: 38px;
}
Div#Section2 {
width: 116px;
height: 38px;
}
Div#Section3 {
width: 78px;
height: 38px;
}
Div#Section1 {
width: 406px;
height: 38px;
}

Thanks for any suggestions or ideas with this, and take care --

Alex

Mar 22 '07 #1
4 9672
On 22 Mar, 16:20, "Alex" <sama...@gmail.comwrote:
If I were to create the following DIV's, how do I make them show-up
side by side?
float

Read <http://brainjar.com/css/positioning/first

Back off on the pixel-based size units too. You're supposed to be
aiming at a fluid design here, otherwise why change?

Mar 22 '07 #2
On Mar 22, 12:37 pm, "Andy Dingley" <ding...@codesmiths.comwrote:
On 22 Mar, 16:20, "Alex" <sama...@gmail.comwrote:
If I were to create the following DIV's, how do I make them show-up
side by side?

float

Read <http://brainjar.com/css/positioning/first

Back off on the pixel-based size units too. You're supposed to be
aiming at a fluid design here, otherwise why change?

Hi Andy,

That is a great article, and though I'm still reading through it (it's
long), I think it will help me in learning more 'tricks' with CSS.

As for my problem at hand, I've been working with Float and have ran
across my first browser issues as I have it working in Firefox but not
IE7. In IE7 it appears it's wrapping. Here's my code:

CSS File:
Div#Main{ position: relative; top: 0px; width: 740px; height: 38px;
background-color: #000000;}
Div#Section1{ position: relative; float: left; width: 140px; height:
38px; background-color: #000000;}
Div#Section2{ position: relative; float: left; width: 116px; height:
38px;}
Div#Section3{ position: relative; float: left; width: 78px; height:
38px;}
Div#Section4{ position: relative; float: left; width: 406px; height:
38px;}

HTML File:

<div id="search">
<div id="SearchIcon">
<IMG height=38 width="140" alt=search src="search1.gif">
</div>
<div id="SearchField">
<INPUT class="SearchBox" size="18" name="searchtext">
</div>
<div id="SearchGo">
<INPUT type="image" alt="go button" src="search_go.gif">
</div>
<div id="TopBanner">
<IMG height=38 width=406 src="home_nursery.jpg" border=0>
</div>
</div>

Now I'm picking it apart to see what I can do to have it look as it
should in IE as well. Any suggestions from the group?

Thanks --

Alex

Mar 22 '07 #3
Alex wrote:
Here's my code:
Post a URL instead.

--
Berg
Mar 22 '07 #4
On 22 Mar, 19:51, "Alex" <sama...@gmail.comwrote:
Any suggestions from the group?
Post a URL. If it's an IE CSS rendering issue, then I wouldn't even
think of looking at it without a working page, served from a real
server with headers on it. Snipped-out fragments just don't give you
enough context of things that are know to break IE.

But searching around "quirks mode" might enlighten you.

Mar 23 '07 #5

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

Similar topics

9
by: Bryan R. Meyer | last post by:
Hello Everyone, The problem of browser resizing has become an issue for me. While redesigning my webpage, I set the left and right margins to be auto so that my content would be centered. ...
4
by: Jane Withnolastname | last post by:
I am trying to re-work an old site by replacing the html with css. On the main page, I have a logo image which I needed centred on the initial screen. I found the solution here:...
11
by: NS | last post by:
I am relativly new to css positioning and have a question regarding the display of a DHTML pop-up Here is the basic HTML I am using: <html> <head> <script language="JavaScript"> <!--
4
by: Richard | last post by:
Hi, I like a demo on layers posted at http://www.echoecho.com/csslayers.htm. It displays two text phrases in separate layers visually overlapped, first with one on top and the other beneath,...
4
by: TheCeej | last post by:
I'm sorry to post what is ultimately a myspace problem, but I'm sure I'd still be having this problem with any html/css document, so the answer would more than likely be able to help anyone out. I'm...
2
by: nonsensitor | last post by:
I'm just learning xhtml & css, primarily from westciv's online tutorials and css guide. I've run into a couple of problems with a page I'm developing that I can't figure out. The first problem is...
5
by: aljamala | last post by:
Hi, I have a group of 5 tables laid out of the web page. 2 go on the left side and 3 on the right. These tables retrieve data from the database so the number of records (rows) returned varies....
2
by: nino9stars | last post by:
Hello, I have just started messing with absolute positioning on webpages, and it definitely let's you do some creative things. Well, after much searching and help, I got the images I was using...
6
by: sooshi | last post by:
Hi all, The height of my page needs to be flexible as the page contains columns with lists which can vary in length. I also have a footer which needs to be stuck to the bottom. I managed to do...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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
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,...

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.