Home > Web Front-end > HTML Tutorial > CSS How to select input_html/css_WEB-ITnose of specified columns

CSS How to select input_html/css_WEB-ITnose of specified columns

WBOY
Release: 2016-06-24 11:52:55
Original
1167 people have browsed it

The table has 20 rows, each row has 10 columns, and there is input in each column. I want to set styles for the inputs in different columns. Setting them one by one is too troublesome, and the code is bloated.

How to directly select, enter which column and set the style. For example:

Specify: columns 1, 2, 3, 5, and 9 are one style, and columns 4, 6, 7, 8, and 10 are another style.


Reply to discussion (solution)

table tr td: nth-child(5) input{background:#0f0;}

Thank you slwsss, let me ask again, I used #table1 tr td{ height:20} to set a height for the TD of the table.

How to reset the height of the first row of the table? Setting it with thead td seems to be useless, it is always 20.

Thank you slwsss, let me ask again, I used #table1 tr td{ height:20} to set a height for the TD of the table.

How to reset the height of the first row of the table? Setting it with thead td seems to be useless. It is always 20.


#table1 tr:first-child td{height:10px;}
Add a class in the first line and use class to determine it
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template