Meaningless Drivel is fun!*
The moose likes HTML, CSS and JavaScript and the fly likes inline stylesheet overwrites attribute ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "inline stylesheet overwrites attribute ?" Watch "inline stylesheet overwrites attribute ?" New topic
Author

inline stylesheet overwrites attribute ?

mark I thomas
Ranch Hand

Joined: Apr 07, 2008
Posts: 86
<input type="text" size="20" style="width: 200px";>

questin:

1. if I don't set style="width: 200px", then the text field looks like 20 char long. After I add that style=.., it looks as long as 200. So whenever there is inline stylesheet, it automatically overwrites the duplicated attributes setting, correct ?

2. when we say 200px, does it have same length as size="200" (no unit here) ?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60802
    
  65

1. Apparently. It's kind of bad form to include competing properties. Pick one or the other. I almost always prefer CSS as size gives a number of characters and is imprecise

2. Depends upon context, but usually in CSS omitting a unit defaults to pixels. size="200" is not the same as "width: 200px" as size is in units of characters.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
Don't get me started about those stupid light bulbs.
 
subject: inline stylesheet overwrites attribute ?
 
Similar Threads
How can i add Horizantal scrollbar in jsf
Space not releasing on toggle of divs
Failed to Set the Height and Width of a Surrounding Box Using DIV
problem in getting the request parameters
popup in small window is not closing automatically