• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

inline stylesheet overwrites attribute ?

 
mark I thomas
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<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
Pie
Posts: 64715
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic