html - Marginal CSS Attributes -


How do you control marginal CSS? By the margin, I mean a word or phrase that requires italic or bolding. It seems stupid that just with a bold class

  bold {font-weight: bold; }  

or italic, either!

  Italic {font-style: italic; }  

But I feel hesitant to put myself in my CSS reset in such a way.

  & lt; P & gt; & Lt; Span class = "italic" & gt; This & lt; / Span & gt; man? & Lt; Span class = "bold" & gt; Is & lt; / Span & gt; are you thinking? & Lt; / P & gt;  

Obviously, if you are going to combine a group of properties to look something different, then it makes sense ...

  .HoverOnMe {color: # 880; Text-decoration: underlined; Font style: italic; }  

But I classify the CSS style above as 'non-marginal'.

We have been taught that such as & lt; B & gt; and & lt; I & gt; is bad because they mix structure and style, and therefore we should not use them. So what is the right way to handle 'marginal CSS'?

When you add an element to a square, name that square according to that name, not What does this look like class = "italic" is an anti-pattern that completely misses the point of separating content and style.

  & lt; Span class = "italic" & gt; This & lt; / Span & gt; man? & Lt; Span class = "bold" & gt; Is & lt; / Span & gt; are you thinking?  

If you want to say what you want to say then this word "this" is a strong word - that is, if you really want to read, you can change your voice while uttering it. One should say with a class name like class = "emphasized" . Although you do not have to do this, because there is already an element in HTML which is specially meaning, especially & lt; Em> .

  & lt; Them & gt; This & lt; / Them & gt; man?  

will be in the form of fate, by default & lt; Em> will present it in the form of italics, so you will not need any more CSS.

You always for it's & lt; Em> should not be used for other reasons a word can be italic, for example it should use a quote (use & lt; cite & gt; ), or in another language Phrase ( & lt; span lang = 'fr' & gt; c'est la vie & lt; / span & gt; ), or a typographic dialect of that meaning without meaning (in that case Use a simple style with & lt; span & gt; style) Use the element that you are trying to say, and adjust the rendering with CSS To match the most closely matches, if the default rendering does not match what you want to show.

The second emphasis presented as bold is by default, :

  & lt; Strong & gt; Is & lt; / Strong> are you thinking?  

This is generally interpreted as "stressed more than" and . If you wanted this, use that tag but again, & lt; Strong> Do not jump for because you want something bold if it's bold, because it's title, then use the title tag. If it should be bold because it is the first line of some article or something, then add class = "first-line" (or just a CSS : first-line selector's Use, where appropriate).


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -