Right way to underline html submit button?

If you absolutely need to style your html buttons, what is the right way to emphasize some of them? for example, "Add to Cart" is usually underlined visually to highlight it.

Option 1 - submit wrapper in em or strong + css

Option 2 - class + css

Option 3 -?

+3
source share
9 answers

CSS is the way to go. For example, in the Facebook Notes application, the Publish button is blue and the rest are gray. All this is done using CSS classes and identifiers.

, , CSS. , Firebug, , .

+5

, , . - , , - /id.

, , .

HTML

<div class="foo">
  <input type="submit" />
</div>

CSS

.foo input
{
 ...some styles
}

, . - , .

+2

, , , , <button> ( <input type="submit"> , ) <em> CSS, :

em button {
    color: blue;
    font-style: normal;
    font-weight: bold;
}

(, <em> <strong> , . "" -, <em> even , .)

+1

<button><em>label</em></button>

IE , < input type="button" > - , em - .

<input type="button" class="emphasized"/>

-..

+1

CSS2 + 3: CSS

input[type="submit"] {
    border: 3px solid blue;
}

: http://www.w3.org/TR/CSS2/selector.html

+1

... ...

" !"

0

, , ...

, . , .

CSS , . < input type="submit" > , < button type = "submit" > [lable here here] </button> . , , .

- , - , , , .

0

- , . , , , . , , , , .

< > , , , , , , <strong> <em> .

, CSS, .

0

. - , .

:

  • (font-size: 120%)
  • (font-weight: bold)
  • ( , , padding: 4px 8px)

- . , , .

- , color, background-color border.

0

Source: https://habr.com/ru/post/1708578/


All Articles