![]() |
|
|
| Subject:
How to make <div> tags line up in a row?
Category: Computers > Programming Asked by: lostandfound-ga List Price: $2.00 |
Posted:
31 May 2004 13:22 PDT
Expires: 30 Jun 2004 13:22 PDT Question ID: 354365 |
What style tags are necessary to make <div> containers line up in a single row rather than a column? For example, the html: <div>blah</div> <div></div> will create containers in a column like such: [] [] What is the simplest way to have them line up in a row like: [][] Basically, I want to use divs work exactly like the following table would: <table> <tr> <td></td> <td></td> </tr> </table> Help? |
|
| Subject:
Re: How to make <div> tags line up in a row?
Answered By: robertskelton-ga on 31 May 2004 14:29 PDT Rated: ![]() |
Hi there,
It is possible, if you use <div> containers in conjunction with CSS.
Here is one example:
<html>
<head>
<style type="text/css">
#left {
position: absolute;
left: 5px;
padding: 0px;
width: 150px;
}
#right{
margin-left: 200px;
padding: 0px;
margin-right: 15px;
}
</style>
</head>
<body>
<div id="left">
</div>
<div id="right">
</div>
</body>
</html>
More information:
NWE Help: CSS DIV Instead of Tables
http://web.nwe.ufl.edu/writing/help/web/authoring/html/css/div.html
Lissa Explains it All -- CSS Two Column and Three Column Layout
http://www.lissaexplains.com/css3.shtml
Search keywords: div instead of tables
Best wishes,
robertskelton-ga | |
| |
| |
lostandfound-ga
rated this answer:
Thanks for the help! |
|
| Subject:
Re: How to make <div> tags line up in a row?
From: karisma-ga on 31 May 2004 16:22 PDT |
Try playing around with a CSS rule that goes like this:
<style>
DIV{
DISPLAY: inline;
}
</style>
<div>1</div>
<div>2</div>
You'll have to do a bit more footwork to get it to look nice, but
hopefully this is a start. |
| Subject:
Re: How to make <div> tags line up in a row?
From: lostandfound-ga on 31 May 2004 16:34 PDT |
Ah, yes! This is precisely what I was looking for. Thanks so much. I knew there had to be a simple solution. |
| Subject:
Re: How to make <div> tags line up in a row?
From: darlingm-ga on 31 May 2004 18:12 PDT |
Also take a look at span. Span's won't take the entire horizantal area by default. <span>1</span> <span>2</span> Sounds like you're having a program generate the HTML. Definately play around with div and span for layout, but many layouts will force you to give them up and go back to tables - if you have more dynamic content like it sounds like you have. Don't be too frustrated by this. |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
| Search Google Answers for |
| Google Home - Answers FAQ - Terms of Service - Privacy Policy |