I am wondering how to go from html formatted tags to CSS. The Html is
Ball: <input type=text name=BL size=5 value=5>
The CSS I have so far is:
#info input[type=text]{}
My goal would be as little html as possible. Thanks :)
I am wondering how to go from html formatted tags to CSS. The Html is
Ball: <input type=text name=BL size=5 value=5>
The CSS I have so far is:
#info input[type=text]{}
My goal would be as little html as possible. Thanks :)
Not entirely sure what your goal is, but you can set it up like:
<input type="text" class="inputfield" name="BL" size="5" value="5" />
And control it with CSS:
.inputfield {
border: 1px solid #000;
font-family: Tahoma, Verdana, sans-serif;
color: #ff0000;
background: #c3c3c3;
}
The only current attribute on the input you could replace with CSS would be size. You would use the CSS width property instead.
#info input[type=text]{
width: 30px;
}
<input type="text" name="BL" value="5">
Though size and width are not exactly the same. size="5" will size the input for 5 characters. Width is (usually) measured by pixels, but you can also use other units of measurement (em, %, pt, pc, mm, cm, in).
size can be used in terms of width of characters of the font selected. The benefit (or drawback, depending on how you look at it) is that users who might have overridden the browser's default font size, will be shown a field with a width of XX characters in that size. When width is specified in CSS, this is not always the case. It's a more definitive property.