Reply to Re: How to put elements next to each other horizontally

Your name:

Reply:


Posted by dorayme on 11/26/07 04:26

In article
<a97fecb1-fd8b-4dd9-b073-5c664c418081@o42g2000hsc.googlegroups.co
m>,
Cristian <crisjunc@gmail.com> wrote:

> I have this div for the top of my page. Nested into it, I have a
> heading and another div. How can I make that heading and div stand
> next to each other horizontally?
> I have tried turning them into inline elements, but always one appear
> in the top and the other in the bottom of it. I have used floats,
> unsuccessfully.
> The home page of Inkscape - http://inkscape.org/ - sets a heading
> next to a div just the way I want it. I have looked into their CSS
> file and tried to do the same, however, I think my knowledge is too
> limited at this moment. Could anyone explain me how to do that?
> Not sure if it works, but I have this example of the HTML I am using.
>
> <body>
> <div id="all">
>
> <h1>Heading</h1>
>
> <div id="right">
> <p>Paragraph</p>
> </div>
>
> </div>
> </body>

Is this the sort of effect you want:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Title</title>
<style type="text/css" media="all">
p {margin-left: 10em; font-size: 1em;}
h1 {float:left; width: 5em; font-size: 2em;}
</style>
</head>
<body>
<h1>Heading</h1>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque augue.Suspendisse consectetuer velit nec neque. Duis
nec orci quis nulla egestas fermentum.Ut quis eros. Aenean at
augue vitae quam posuere vehicula. Pellentesque habitantmorbi
tristique senectus et netus et malesuada fames ac turpis egestas.
Maecenas justonunc, porta sed, molestie eget, adipiscing id,
ante. Cum sociis natoque penatibus etmagnis dis parturient
montes, nascetur ridiculus mus. Suspendisse potenti. Nunc
blanditmagna id odio sodales luctus. Nulla quam magna, viverra
quis, dignissim blandit, viverra nec, odio.</p>
</body>
</html>

?

There are some nice issues here.

--
dorayme

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация