Uses class names such as right, considered bad practice?

If I have class names like "left", "right", "clear" and xhtml like

<a href="index.php" class="right continueLink">Continue</a>

With CSS like

.right {
float: right;
}

I know this is not a semantic name, but sometimes it is much easier.

Anyway, what are your thoughts?

+3
source share
7 answers

I do not think this is a very good idea. Now, when you (or the future maintainer) change your site layout, you will either have to change .rightto {float:left;}(obviously a bad idea) or browse all your HTML files and change rightto left.

, , .continueLink ? , .

+14

css - html-.

( "", " ", "", "", "",...).

, ( "left", "right", "footnotes", "sidenotes",...), , Zen Garden , div .

+6

, , . .right float: left?

+2

, , CSS, . , .

, . : menuleft, menuright ..

+1

, , , . , .

, , , , html css css html, , . , , - , , html css.

, - , . ; , className, "right".: -)

+1

.right , , , float:right, , , :

float:right; -, wil , display:block , "a" . , . , , , , , CSS.

html, div- , div .

div#sidebar { float:right; width:200px; }
div#sidebar ul { list-style-type:none; }

css, css-, , .right , css , .

, , , , 8 30+, , HTML.

, , - , . , css , , , , .

Jesper Hauge

0

, , , , , , "".

, "alt" - .

0

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


All Articles