Freelancers Network
 
skill list top cap
Homepage
Join the Freelancer's Network
Update your details
Find a freelancer
Post a project
Find a project
Projects Archive
Post a job
Find a job
Jobs Archive
See Dan's Pages
See Andy's Pages
Link to this site
Resources
Join/Leave Forum
Forum Messages
+Additions+ Adverts
Advertising
Contact Us
Subscribe to our newsletter - enter your email address and hit return
Freelancers.net is owned and operated by Andy Stowell and Dan Winchester
skill list end cap
guru web hostcom

Find me again on Freelancers.net

Re: FN-FORUM: CSS abnormality

date posted 26th May 2006 09:02

Ian Copeland wrote:
> Yes, I can do that later today.
>
> -----Original Message-----
> From: Tony Crockford [EMAIL REMOVED]
> Sent: 26 May 2006 09:39
> To: FN-FORUM / [EMAIL REMOVED]
> Subject: Re: FN-FORUM: CSS abnormality
>
>
> Ian Copeland wrote:
>> Hey Stan,
>>
>> I tried putting align="center" inside of the image tag but that didn't
> work
>> either!
>>
>> Ian
>>
>> -----Original Message-----
>> From: Stanislav Cmakal [EMAIL REMOVED]
>> Sent: 25 May 2006 22:17
>> To: FN-FORUM / [EMAIL REMOVED]
>> Subject: Re: FN-FORUM: CSS abnormality
>>
>>
>> Hi Ian,
>> that should work. Any change that is actually problem with the browser
>> cache?
>> Or why don't you use align="center" inside of img tag?
>> Stan
>>
>> On 25 May 2006, at 2:52 pm, Ian Copeland wrote:
>>
>>> Hi,
>>>
>>> I have some text placed in a div, with CSS, on a page. I have another
>>> div
>>> underneath with an image and some text broken up by a . All the
>>> text is
>>> centered except for the image, even though it is under the same class
>>> as the
>>> other text! What's going on? Why isn't the image centered as well?
>>>
>>> HTML =====================
>>>
>>>
>>>
>>>
>>> Blah blah blah
>>>
>>>
>>>
>>>
>>> Blah blah blah
>>>
>>>
>>>
>>>
>>> CSS =====================
>>>
>>> .speech_main_text {position: absolute; top: 140px; right: 10px; left:
>>> 250px;
>>> text-align: justify}
>>>
>>> .normal_top {color: #696969; font-family: verdana, arial, sans-serif;
>>> font-size: 9pt}
>>>
>>> .bottom_text {position: relative; top: 25px; bottom: 25px; text-align:
>>> center}
>>>
>>> =========================
>>>
>>>
>>> PS no jokes about the #696969. it's a nice grey...
>>
>
> mixing text and an image is the problem I suspect - images shouldn't
> be treated as text and shouldn't obey the text-align:center (they
> sometimes do...)
>
> can you put this code online where we can see it - there may be
> something else affecting it.

actually, I just took the time to test your code in FF and IE - the
reason it doesn't center in IE is that the divs do not have a width,
but are positioned absolutely, which gives IE headaches.

add a width to .bottom_text and it will work.

There are other issues though - the way you're doing it isn't the best
way - add borders to the divs

div{
border: 1px solid red;
}

and you'll see that (correctly) the text and image drop out of the div
they're in into the containing div - this may become a problem at some
point.

Absolute positioning isn't the best way to do this - other content
will ignore the position of these divs....

maybe show what you're trying to do and we could suggest the best way
to do it.

hth

;o)





--
Join me: http://wiki.workalone.co.uk/
Thank me: http://www.amazon.co.uk/gp/registry/1VK42TQL7VD2F
Engage me: http://www.boldfish.co.uk/portfolio/



Messages by Day
May 31st 2006
May 30th 2006
May 29th 2006
May 28th 2006
May 27th 2006
May 26th 2006
May 25th 2006
May 24th 2006
May 23rd 2006
May 22nd 2006
May 21st 2006
May 20th 2006
May 19th 2006
May 18th 2006
May 17th 2006
May 16th 2006
May 15th 2006
May 14th 2006
May 13th 2006
May 12th 2006
May 11th 2006
May 10th 2006
May 9th 2006
May 8th 2006
May 7th 2006
May 6th 2006
May 5th 2006
May 4th 2006
May 3rd 2006
May 2nd 2006
May 1st 2006


Messages by Month
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006


Messages by Year
2008
2007
2006
2005
2004
2003
2002
2001
2000