473,604 Members | 2,686 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

One <DIV> and another one followed: how to place them in different rows?

Hi.

I've got this piece of code:

----------------//---------------------
<html><head>
<style type="text/css">
#block {margin:0 0 0 0; display:block;}
..left-pic {display:block; float:left;}
..right-pic {display:block; float:right;}
</style>
<body>
<div class="block">
<div class="left-pic">
<img src="http://www.google.com/images/logo_sm.gif" />
</div>
</div>
<div class="block">
<div class="right-pic">
<img src="http://www.google.com/images/logo_sm.gif" />
</div>
</div>
</body></html>
-------------//----------------------

The two logos (two 'div-block's) are in the same row, but I want they
are in different rows. I mean, the first 'div-block' (with one pic on
the left) in one row, and the second 'div-block' (with another pic on
the right) in another row.

I don't want to use tables.

I tried inserting <br> between two div's, but it does not work.

Any suggestion? Thank you very much.
Jul 20 '05 #1
1 4411
fr**********@eu rope.com (Francesco Moi) wrote:
Hi.

I've got this piece of code:

----------------//---------------------
<html><head>
<style type="text/css">
#block {margin:0 0 0 0; display:block;}
You don't have any elements with id="block", so this will have no
effect. If you want to apply this to the elements with class="block",
then you need ".block".
.left-pic {display:block; float:left;}
.right-pic {display:block; float:right;}
</style>
<body>
<div class="block">
<div class="left-pic">
<img src="http://www.google.com/images/logo_sm.gif" />
</div>
</div>
<div class="block">
<div class="right-pic">
<img src="http://www.google.com/images/logo_sm.gif" />
</div>
</div>
</body></html>
-------------//----------------------

The two logos (two 'div-block's) are in the same row, but I want they
are in different rows. I mean, the first 'div-block' (with one pic on
the left) in one row, and the second 'div-block' (with another pic on
the right) in another row.


..block {margin:0 0 0 0; display:block; clear: both;}

By the way: there's no need to specify "display: block;" for a style
that will only be applied to elements that are blocks anyway, and
"margin: 0;" is a useful shortcut for "margin: 0 0 0 0;".

--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ôter le premier point de mon adresse de courriel.
Jul 20 '05 #2

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

Similar topics

13
3391
by: Mikko Ohtamaa | last post by:
From XML specification: The representation of an empty element is either a start-tag immediately followed by an end-tag, or an empty-element tag. (This means that <foo></foo> is equal to <foo/>) From XHTML specification:
3
7754
by: KathyB | last post by:
Hi, totally new to the div show/hide thing. I have some rows in a table. When I first load the page, I only want to see divs where the divID=ForView. When I load now, I see BOTH rows...even though I have one set to style="display='none'". When I click on the Edit button on a row, I want to hide that row and in its PHYSICAL place show the ForEdit div for that item...leaving all other divs as is. I've seen some examples, everyone seems...
61
24443
by: Toby Austin | last post by:
I'm trying to replace <table>s with <div>s as much as possible. However, I can't figure out how to do the following… <table> <tr> <td valign="top" width="100%">some data that will 'stretch'</td> <td valign="top" width="300">some data that won't 'stetch'</td> </tr> </table>
8
5135
by: slim | last post by:
hi again all, i am still working on the website as mentioned in earlier threads and have hit another snag... http://awash.demon.co.uk/index.php http://awash.demon.co.uk/vd.css the php is pulling a name and placing it under the thumbnail (the text is
44
919
by: Jim M | last post by:
I have had great success with using <iframe> with overflow-y set to auto. I can get a similar look with the <iframe> tag. BUT... In all cases I need to have fixed heights. Is there a way to put either tag inside an HTML <TD> and have the same kind of scrolling effect. This would allow me to fill the screen and have the size of the scrolling box change on resize. Thanks in advance.
4
2354
by: David | last post by:
I attempted the following <div id="div" runat="server"> <tr><td></td></tr> <tr><td></td></tr> </div> This is to hide a group of rows depending on some business rules in my code behind.
3
4196
by: John Pote | last post by:
1. Horizontal centering a <divin browser window. The current trend seems to be to place page content in a fixed width area in the middle of the browser window. How is this achieved? If I use a top level <divthen I can place it with CSS attribute 'left:', but this is a fixed offset. Is it possible to have a <divcentered in the browser window? 2. Verticle centering in <div>
28
5337
by: Kent Feiler | last post by:
1. Here's some html from a W3C recommendations page. <P>aaaaaaaaa<DIV>bbbbbbbbb</DIV><DIV>cccccccc<P>dddddddd</DIV> 2.Although I didn't think it would make any difference, I tried it with the </p>s included as well. <P>aaaaaaaaa</p><DIV>bbbbbbbbb</DIV><DIV>cccccccc<P>dddddddd</p></DIV>
8
10028
prino
by: prino | last post by:
Hi all, I've written code (in REXX) that takes files in legacy languages (PL/I, COBOL, z/OS assembler, etc) and converts them into HTML in a format similar to what's displayed in the z/OS ISPF editor. A fellow member of the PCG has helped me by creating a bit of Javascript to emulate the scrolling and using Google I've now gotten it into a state where it almost passes the W3C Markup Validation Service. However, the one error, Error Line 166,...
0
8419
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
8406
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
8065
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
8274
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6737
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...
0
3906
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3954
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1522
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1262
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.