Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 18th, 2006, 3:25 AM   #1
DaveQB
Newbie
 
DaveQB's Avatar
 
Join Date: Apr 2006
Location: Sydney
Posts: 14
Rep Power: 0 DaveQB is on a distinguished road
Send a message via ICQ to DaveQB Send a message via Skype™ to DaveQB
Image float, wrap text, oh boy!

I'll get straight to the point.

I need to have a heading thats centred and reasonably large font. Also, need to have an image "floated" to its left. Thoe obvious problem is that the float pushes my text over to the right so its not centre aligned.

Here's a snapshot of my current working.



I have tried using absolute and relative positioning, but the variability its moving around the page and covering the text up between browsers has been annouying to the say the least.

A recent thought I have just had, but have implemented yet, is to make the first line and the image 1 image thats centred and then centre the remaining text below that. Of course the problem is the text as an image won't look crash hot and wouldn't make it all as liquid and consistent then if could be, I think.

Any suggestions are most welcome.
DaveQB is offline   Reply With Quote
Old May 20th, 2006, 12:34 AM   #2
somehollis
Programmer
 
somehollis's Avatar
 
Join Date: May 2006
Location: Memphis, TN
Posts: 31
Rep Power: 0 somehollis is on a distinguished road
Send a message via AIM to somehollis
I think this can actually be done rather easily without messing with floats, or positioning. Just using a bit of CSS ought to do the trick.

CSS Section:
#heading {
	text-align:center;
}
#headimage {
	background-image:url(images/someimage.jpg);
	background-repeat:no-repeat
}

And the xhtml to go with it:
<div id="heading">
	 <div id="headimage">
	     <p>Title Here</p>
	</div>
</div>

I tested this very hastily in firefox and IE 6 in Windows, and it appeared to work fine. Let me know if any of this is unclear, and I'll try to say it better.
somehollis is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:20 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC