473,729 Members | 2,355 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2373
On Sat, 04 Feb 2006 04:32:05 +0100, <tx****@gmail.c om> 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_horiz ontaal-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.
--
______PretLette rs:
| 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.co m 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
7113
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 property. This works for IE6 but Opera7.54 and Netscape7.1 add large line spacing between the text blocks and any lines of wrapped text. The line spacing is independant of the font size and is consistent between all lines. ie: it's not larger...
4
7736
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 uses this kind of block floating, they don't wrap to build a whole new line but instead get "hooked" at the left-most element being larger than the element right beside this "overflowing" element.
23
3157
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 0H0</p> <p class="Telephone">Telephone: 555-1234 </p> <p class="Fax">Fax: 555-4321</p> </div>
1
1445
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 know there is a relatively new CSS property that does display: inline for blocks, what is that and what is the level of support? Cheers, Jeff
5
2173
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 other on the left three block elements ("bouton") on top of the base line. Here's what I tried: #aa, #bb, #cc {width: 140px; padding-top: 3px; display: inline;}
12
5575
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
16482
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 as I would like? I've been playing with the following selector in my attempts to get at the text portion: input + * {width:180px;} So far my attempts have produced weirdness in FF and nothing occurs in IE7. Although beyond the scope of this...
2
8686
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 with two divs to get them to render side by side: <div style="width:12em;border: 2px solid #EFCE8C; padding: 0.5em;display:inline;">abc</div> <div style="width:12em;border: 2px solid #EFCE8C; padding:
0
8917
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8761
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9426
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9281
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9200
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8148
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2680
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2163
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.