Div tag with no carrige return, is it possible?

P

Paul D

HI! Is it possible to have a div tag with no carriage return, I notice that
if we have an text or an image and insert an div tag with content in it that
in code view it will automatically add a carriage return ( meaning that in
design view that text or image is not in line with the content of the div
tag).

Is there a way around this. ( perhaps css? but how?).

Paul
 
P

Paul D

Paul said:
HI! Is it possible to have a div tag with no carriage return, I notice
that if we have an text or an image and insert an div tag with content in
it that in code view it will automatically add a carriage return (
meaning that in design view that text or image is not in line with the
content of the div tag).

Is there a way around this. ( perhaps css? but how?).

Paul

HI! all, the solution to this and other block elements is to use CSS, you
can specify a DIV to be an inline element.

example:

div {
display: inline;
vertical-align: bottom;
}

This will align text and a div next to it without a carriage return or line
break.

Here is another example of a block element behaving like an inline element.

h1 { display: inline; }

Well that's it. Hope this helps someone :)

Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top