Home > Web Front-end > HTML Tutorial > 100Solution to strange CSS descendant selector problem_html/css_WEB-ITnose

100Solution to strange CSS descendant selector problem_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:17:00
Original
958 people have browsed it

I define the select, textarea style for list.aspx in the my.css file, as follows:
#myinput div input, textarea, select{ position:absolute; left:100px;}

Result This css definition actually affects the select and textarea effects on my other page (add.aspx), and add.aspx does not have the ID #myinput at all. Why does it still affect its select?

Solution


Reply to discussion (solution)

#myinput div input, textarea, select
Didn’t you add a comma? Description
#myinput div input
textarea
select
These three all conform to { position:absolute; left:100px;}
If you only want the select below #myinput to be valid, like this Write:
#myinput div input,textarea,#myinput select{ position:absolute; left:100px;}

Haha, thank you, I got the wrong concept.

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