williamrouse Posted January 1, 2010 Report Posted January 1, 2010 I thought that if I had an image in a DIV, followed by some text I could surround the contents of the DIV with span to maintain the flow, as opposed to having the text below. The Title of My Web Page When I do the above, the is under the image and my editor suggest something is askew. Quote
falkencreative Posted January 1, 2010 Report Posted January 1, 2010 You might need to clarify what you mean when you say you want to "maintain the flow." I'm not sure how/why you would use a tag in that way... That isn't how it's supposed to be used. A span tag is similar to a div, except that it displays inline, rather than block (which forces elements within it down to a new line). http://www.w3schools.com/TAGS/tag_span.asp http://www.w3schools.com/css/pr_class_display.asp The only way to move the h1 above the image is to move the code, so that the h1 is above the image within the code, or to use absolute positioning on the h1 to move it into position (which I wouldn't recommend). Quote
falkencreative Posted January 1, 2010 Report Posted January 1, 2010 If you are wanting to have the h1 to the right of the image, you'd need to do that by floating either the image (floating the image left) or the h1 (floating it right), or floating both left. Both the h1 and the image use display:block, so they are going to display on their own lines unless you change that by floating them or using absolute/relative positioning. Quote
williamrouse Posted January 1, 2010 Author Report Posted January 1, 2010 The "above" refers to the code above the sentence. I want it to be inline and not block. Quote
williamrouse Posted January 1, 2010 Author Report Posted January 1, 2010 OK! thanks, that makes sense. let me try to do that. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.