Forum Moderators: not2easy

Message Too Old, No Replies

Positioning Header after Paragraph

         

hexdj

2:34 am on Apr 14, 2006 (gmt 0)

10+ Year Member



I have an H2 that has a background image. I want this H2 to be centered both vertically and horizontally within its parent DIV. I would like, however, to have the text in my P (which in my HTML comes after my H2) to break where my H2 is positioned.

Example:

<h2>This is My Title</2>
<p>Paragraph goes here, blah blah blah</>

I want it to look like this:

Paragraph goes here,

[THIS IS MY TITLE (image)]

blah blah blah

How can I center this H2 vertically and horizontally and have my P wrapped around my H2?

Thanks

hexdj

1:59 am on Apr 15, 2006 (gmt 0)

10+ Year Member



Any Suggestions?

doodlebee

1:44 pm on Apr 16, 2006 (gmt 0)

10+ Year Member



Vertically is an issue. With CSS, it's difficult to accomplish.

As for wrapping your <p> around it, you can float the <h2> - it will cause the lines to break and wrap around it. but to divide it? I don't know - you can't even really do that in tables without some effort.

hexdj

7:55 pm on Apr 16, 2006 (gmt 0)

10+ Year Member



But I can only float it left or right, is there any way I could center it at least horizontally?

doodlebee

3:37 pm on Apr 25, 2006 (gmt 0)

10+ Year Member



yeah - set your margin.

margin:0 auto; typcally centers block elemts - but normally you need to have a defined width. How well it'll work for a header, I don't know.