Home >Web Front-end >HTML Tutorial >.clock div{position: absolute;border-style:solid;} What does this mean? Can anyone tell me? I don't know what's going on_html/css_WEB-ITnose

.clock div{position: absolute;border-style:solid;} What does this mean? Can anyone tell me? I don't know what's going on_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:25:542214browse

I found an example of using CSS to create LED digital effects on the Internet. There are two lines of CSS in it:
.clock{font-size:12px;width:9em;height:14em;border:1px solid #ddd; position:relative;}
.clock div{position: absolute;border-style:solid;}

My question is in the second line, what is the purpose of the div in .clock div Is it an identifier, a div used to control .clock, or other uses? Please give me some advice!


Reply to the discussion (solution)

You are also good at CSS. . . . . . .

This is the most basic CSS selector.

.clock div

The previous one selects all tags with class="clock". It does not consider which tag it is, as long as the tag contains class="clock".

The latter one is to find all the child elements whose tags are div based on the previously selected tags.


                                                                              will be selected.


//This will not be selected.


There are many methods, it is recommended to check the basic knowledge of CSS first

Okay, thank you very much,

I rarely write BS projects, I do it in CS More,
According to what you mean.clock div{position: absolute;border-style:solid;}, is the tag applied to all divs in class=clock, right? I just checked some information, and what you said It's a bit close, but yours is more popular. . .

Can I ask something more?



What does this citation style mean


Got it, set multiple styles,

Statement:
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