PJCH
PJCH

Reputation: 9

Border not showing up on submit button

When I tried adding a border to the style for my button, it didn't show up. I've done this successfully before, but have no idea what I've done wrong this time.

Here's the HTML:

<input name="submit" type="submit" class="mediumbutton" value="Submit">

And here's my CSS:

.mediumbutton {
    width: 140;
    height: 40;
    font-family: Arial, Helvetica, sans-serif;
    color: #666;
    font-size: 24px;
    background-color: #DDD;
    border: 3px;
    border-color: #000;
}

Thanks.

Upvotes: 0

Views: 3510

Answers (1)

reisio
reisio

Reputation: 3242

You’re lacking a border-style, try border: 3px solid #000000;.

"Since the initial value of the border styles is 'none', no borders will be visible unless the border style is set." — http://w3.org/tr/css21/box.html#propdef-border-style

Additionally, your width and height property values are missing a unit of measurement. While input elements are somewhat of an exception, ordinarily if such dimensions are applying despite lacking such units, it could be an indication your document is being rendered in quirks mode, which can be rectified by ensuring that a proper doctype declaration (<!doctype html>) is properly included (should be the very first line with absolutely nothing before it).

Upvotes: 5

Related Questions