472,977 Members | 2,019 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

HELP | How can I display DIVs block by block INLINE? | key: div display:inline

the HTML is:
----------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
"http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
<head>
<title>foo</title>
<style type="text/css">
<!--
..b {
width:200px;
height:100px;
}
#one {
background: #900;
}
#two {
background: #090;
}
#three {
background: #009;
}
#four {
background: #099;
}
#five {
background: #909;
}
->
</style>
</head>
<body>

<div class="b" id="one">111111</div>
<div class="b" id="two">222222</div>
<div class="b" id="three">3333</div>
<div class="b" id="four">44444</div>
<div class="b" id="five">55555</div>

</body>
</html>
---------------------------------------------------
now, they dispaly like:
+-------------+
|11111 |
+-------------+
|22222 |
+-------------+
|33333 |
+-------------+
|44444 |
+-------------+
|55555 |
+-------------+

but I want it to display like:
+-------------+-------------+-------------+-------------+-------------+
|11111 |22222 |33333 |44444 |55555 |
+-------------+-------------+-------------+-------------+-------------+

so I added "display:inline" to .b:
..b {
display:inline; /*added*/
width:200px;
height:100px;
}

but the "width" and "height" are not working!
I mean, they display one by one, not block by block.

I need your help, thank you!

Feb 4 '06 #1
4 2333
On Sat, 04 Feb 2006 04:32:05 +0100, <tx****@gmail.com> wrote:

so I added "display:inline" to .b:
.b {
display:inline; /*added*/
width:200px;
height:100px;
}

but the "width" and "height" are not working!


Inline elements (or elements pretending to be inline) don't have a width
or height. If you want the block elements to keep a specific height and
width, you have to let them be block elements.

What you could try is to float them left. If you don't want a line break
to a new line if the viewport is too narrow to display them all in line,
you could wrap them in a containing div and add the property/value
'white-space:nowrap;'.

This layout is usually used for a menu bar. An example for a basic
horizontal menu bar you can find in
<URL:http://www.pretletters.net/_test/voorbeeld_horizontaal-menu.html>.
But I'm guessing this is what you might want, because you're not very
specific about the functionality it is you're adding to your page.
--
______PretLetters:
| weblog | http://www.pretletters.net/weblog/weblog.html |
| webontwerp | http://www.pretletters.net/html/webontwerp.html |
|zweefvliegen | http://www.pretletters.net/html/vliegen.html |
Feb 4 '06 #2
tx****@gmail.com wrote:
the HTML is:
Don't post code to the group, upload it, post the url
Subject: HELP | How can I display DIVs block by block INLINE? | key: div display:inline


If you have a question, make sure it's not just in the header, repeat it
in the message body.

Search the group's archive for "inline-block".

--
Spartanicus
Feb 4 '06 #3
thank you.
I will remind myself.

Feb 4 '06 #4
thank you.
I learned much.
the semi-manufactured goods:
http://blog.blogwhy.com/txican

Feb 4 '06 #5

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

Similar topics

7
by: Danny | last post by:
I have a small <div> element which contains two text blocks - one within <h5> tags and the other within <p> tags. I don't want any extra line spacing between elements so use the display:inline...
4
by: Axel Dahmen | last post by:
Hi, current browsers don't support "display: inline-block;" and "display: inline-table;", resp. Thus I'm using "float: left;" to achieve a similar effect. Problem is that if a row of elements...
23
by: Mat | last post by:
<div id="container"> <div id="main"> <div id="header"> <p class="Address">123 Fake Street, </p> <p class="City">Crazy City, </p> <p class="Province">Ontario </p> <p class="PostalCode">H0H...
1
by: Jeff Thies | last post by:
I have a number of blocks of content (product items) that I want to wrap naturally at the end of the line. float: left has the unhappy habbit of stacking up where the lowest extending block is. I...
5
by: Haines Brown | last post by:
A much discussed issue, but I'm unable to get results. Using galeon as browser. I have a div, the bottem border of which is solid and serves as a base line. My aim is to line up next to each...
12
by: Vadim Guchenko | last post by:
Hello. I'm using the following code: <html> <head> <style type="text/css"> pre {display: inline;} </style> </head>
11
by: totalstranger | last post by:
I have a check box with let's say 20 elements. I would like to have it align as 4 columns, 5 rows. Without using a table and using understandable CSS is there any way to make the check boxes align...
2
by: Steve Richter | last post by:
I would like to use display:inline and other CSS attributes to build an entry form. Where the heading to the left of the text box is always a set width. It is not working so I am experimenting...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.