A
A
Anton Hoffman2015-10-21 13:13:16
css
Anton Hoffman, 2015-10-21 13:13:16

How to exhaustively find out which css properties can be applied to which html tags?

As you know, there are a large number of css properties, but I can’t find in the documentation where it would be clearly stated to which html tags this or that property can be applied. How can you find out?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Denis Ineshin, 2015-10-21
@IonDen

You can apply any properties to any tag. The differences between tags are mainly in their purpose, so that it is easier to read the HTML code. Otherwise, they are universal in terms of CSS styling. There are minor differences only in what styles they have by default. For example, the h1 tag has an increased font-size, etc.
A slight exception is form elements, you can also apply any CSS to them, but not any will work.

M
Mikhail Osher, 2015-10-21
@miraage

I always use mozilla developer network and caniuse for such purposes.

E
Elena, 2015-10-21
@olenne

The purpose of most properties can be understood from the name. For example:
text-decoration - text decoration, which means it is suitable for all html elements that contain text;
letter-spacing - the distance between the letters of the words, again means for the text;
border - any element can have borders, so it is suitable for all elements;
content - generated content. Before any element, you can add content, so it is suitable for all elements.
And so on...
First you need to read about block and inline elements, just between these groups there are differences in the properties used. For example, css transforms only work on block elements.
Alternatively, readhtml5book.ru/css-css3 , where css-properties are listed according to the main elements, html5book.ru/css3-tables - everything that can be set for tables.
And a clear list will only slow you down, you need to read about the properties and think about which elements you can apply them, try with examples, so you'll figure it out faster.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question