Vertical alignment weirdness?

View: New views
3 Messages — Rating Filter:   Alert me  

Vertical alignment weirdness?

by Ian Skinner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Any idea why the doctype would matter concerning the following CSS?

div#sideNav a:before
{
        content: url(left_curve.gif);
        vertical-align: bottom;
}

When used with a HTML transitional doctype it works as expected with the included image aligned to the bottom of the inline a element.

When used with a XHTML strict doctype it does not line up with the bottom of the inline a element, but rather only lines up with the baseline.

I have not tried other doctypes yet.  This has been tested in Firefox; it obviously does not apply in IE since IE currently does not know how to handle generated CSS content.

TIA


--------------
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

---------
| 1 |   |
---------  Binary Soduko
|   |   |
---------
 
"C code. C code run. Run code run. Please!"
- Cynthia Dunning

Confidentiality Notice:  This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:41:2609
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/41
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:41
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.41
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

RE: Vertical alignment weirdness?

by Sandra Clark :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Doctype is used by browsers to determine rendering mode.  No Doctype or
Doctypes other than HTML 4.01 Strict, HTML 4.01 Transitional, xHTML 1.0
Transitional or xHTML 1.0 Strict will trigger quirks mode in some browsers.
The above referenced doctypes trigger standards mode.

http://hsivonen.iki.fi/doctype/ 


Sandra Clark
==============================
http://www.shayna.com
Training in Cascading Style Sheets and Accessibility
-----Original Message-----
From: Ian Skinner [mailto:ian.skinner@...]
Sent: Friday, May 26, 2006 2:52 PM
To: CSS
Subject: Vertical alignment weirdness?

Any idea why the doctype would matter concerning the following CSS?

div#sideNav a:before
{
        content: url(left_curve.gif);
        vertical-align: bottom;
}

When used with a HTML transitional doctype it works as expected with the
included image aligned to the bottom of the inline a element.

When used with a XHTML strict doctype it does not line up with the bottom of
the inline a element, but rather only lines up with the baseline.

I have not tried other doctypes yet.  This has been tested in Firefox; it
obviously does not apply in IE since IE currently does not know how to
handle generated CSS content.

TIA


--------------
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

---------
| 1 |   |
---------  Binary Soduko
|   |   |
---------
 
"C code. C code run. Run code run. Please!"
- Cynthia Dunning

Confidentiality Notice:  This message including any attachments is for the
sole use of the intended
recipient(s) and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited. If you
are not the intended recipient, please contact the sender and delete any
copies of this message.





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:41:2610
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/41
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:41
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.41
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Parent Message unknown RE: Vertical alignment weirdness?

by Ian Skinner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Doctype is used by browsers to determine rendering mode.  No Doctype or Doctypes other than HTML 4.01 Strict, HTML 4.01 Transitional, xHTML 1.0 Transitional or xHTML 1.0 Strict will trigger quirks mode in some browsers. The above referenced doctypes trigger standards mode.

http://hsivonen.iki.fi/doctype/

I ran across that link in my googling on this problem, but it did not answer my question as best as I can tell.

I am using doctypes in all my documents.  But I am getting different behavior when I use transitional doctypes versus strict doctypes and I do not understand why.

These doctypes provide the behavior I expect, where the generated images line up with the bottom of the inline box.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

These doctypes do not provide the behavior I expect.  The generated images only line up with the base line of the inline box.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

I would like to understand this difference if at all possible.


--------------
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

---------
| 1 |   |
---------  Binary Soduko
|   |   |
---------
 
"C code. C code run. Run code run. Please!"
- Cynthia Dunning

Confidentiality Notice:  This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message.




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:41:2611
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/41
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:41
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.41
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54