How To Float Right of Two Elements (Both an H2 and a P)

Oh yeah, on the slithering prevention, overflow:hidden sometimes doesn’t work until you add ;width:100%.

H1 is too large.

That’s why we have CSS, to change the appearance of elements to whatever we like.

h1 { font-size: 1.2em }

h2 is too small, from a semantic point of view.

This illustrates the point.

It’s just an example

Yes, I did not mention it before as I assumed it was just a snippet of of html from a larger page, not the entire page.
But @coothead is absolutely correct about starting with h1. Choosing a heading (or any element) based in its appearance or sizing is wrong. Use the correct element based on that element’s meaning. Then let css take care of how you want it to look.

1 Like

Appearance should have NOTHING to do with with your choice of semantic tags. :scream:

CSS is what you should use for setting it’s appearance. :sunglasses:

coothead

1 Like

What other ways are there to stop css from slithering text up between images?

I’m not sure what you mean by ‘slithering’.
Do you have an example of a page where yo see this?

You’ve seen text come up between images.

Put the floated images in a parent container and apply {overflow:hidden} to that parent container. The text should begin after the parent container.

That was one of the two ways mentioned. I was just wondering if there is a third way. The other way is to use a media query to kick in just before the slithering starts.

A media query to do what? Your description is a bit sparce of substance.

What third way would you like to hear? What else can you imagine?

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.