- This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
Viewing 8 posts - 1 through 8 (of 8 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
I don’t want to have that text bellow my image. Is there any technique to do it?
Thanks.
It depends on the image size but something like this: http://jsfiddle.net/nTHTN/1/
**Note**: Text should **always** be in a text element of some kind (usually a `
` tag) so I have update your fiddle to include that especially as it allows us to style it specifically.
My image has that height.
I was implementing that approach but I would like to have my text grow if there is no image (http://jsfiddle.net/nTHTN/2/). Is it possible to have both?
>My image has that height.
No idea how this relates.
As for your other query, I think it might but I’d have to think about it some more.
img ~ p
perhaps, people?
Didn’t know about that ~ symbol. Does it mean “select only images followed by p”?
That’s almost perfect, just need to make sure to include the `.contents` as well:
http://codepen.io/ggilmore/pen/cb6fcb195f2fc2bc09239d990839e9db
img {
float: left;
}
img ~ .contents p {
margin-left: 130px;
}
[Edit] ha! I see I was too slow!
>Does it mean “select only images followed by p in a element with a class of contents”?
Not it only targets paragraphs that are after an image.
http://net.tutsplus.com/tutorials/html-css-techniques/the-30-css-selectors-you-must-memorize/