Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Margin properties with <p><img ..>
Old 08-09-2006, 11:55 AM Margin properties with <p><img ..>
Junior Talker

Posts: 3
Name: Adam Jackson
Trades: 0
Hi all,


Why am I losing the paragraph style when the first element in the paragraph is an image file?

For example, the style specifies

P {font: 9pt Verdana, Helvetica, sans-serif; margin-left: 5%; color: white; margin-right: 10%}

But when the first paragraph on the page begins

<p><img src="images/arrow.gif">Latest news ...

everything is jammed up against the left-hand margin, as though the margin-left attribute has been cancelled out -- and not just for this paragraph, but all following, including those which don't begin with an image.

And this is only with IE6 -- Firefox 1.5 retains the formatting.
Must be a simple solution, but can't figure it out.

abjack is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-09-2006, 12:06 PM Re: Margin properties with <p><img ..>
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,898
Name: Keith Marshall
Location: Connecticut
Trades: 0
Do you have a live link you can show us?

Your margins are defined by a percentage of the available width, it might have something to do with it if the browser window is not maximized.
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 08-09-2006, 12:22 PM Re: Margin properties with <p><img ..>
Junior Talker

Posts: 3
Name: Adam Jackson
Trades: 0
Sure thing --

Tim Turnbull - poetry and performance


Same problem whether the window's maximised or not ...

I'm sure I've had this bug before, but I'm still quite new to CSS and never got round to sorting it out ...

The CSS is all inline & available to view.
abjack is offline
Reply With Quote
View Public Profile
 
Old 08-09-2006, 12:32 PM Re: Margin properties with <p><img ..>
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,898
Name: Keith Marshall
Location: Connecticut
Trades: 0
Instead of defining margins, try padding within the <p> tags.
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 08-09-2006, 12:38 PM Re: Margin properties with <p><img ..>
Junior Talker

Posts: 3
Name: Adam Jackson
Trades: 0
Will do -- many thanks.

But then I'm still needing to set the overall margins for the text -- wouldn't padding only serve to
indent from the first word, but overrun as a line into the far margin again?

[ - - - - -] This paragraph had one padding specified(left), using
directional declaration.

Last edited by abjack; 08-09-2006 at 12:42 PM..
abjack is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Margin properties with <p><img ..>
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.84755 seconds with 12 queries