Let's take a look at the CSS statements below, which are some of the problems I have encountered in the past. Can you guess? You 'd better first reply and talk about what you think is the correct answer! Then let's look at the effect! This is interesting! If you have all the right answers, come and have a cool!
1. Guess what the background color is?
Answer:
A: red
B: blue
Which one do you choose?
| The code is as follows: |
Copy code |
<Style> body {background: blue} </style>
</Head>
<Body bgcolor = "red">
|
Think about the background color?
</Body>
2. Guess what color the text is?
Answer:
A: red
B: blue
Which one do you choose?
| The code is as follows: |
Copy code |
<Style>
. Red {color: red}
Body {color: blue}
</Style>
</Head>
<Body class = "red">
|
Think about the color of text?
</Body>
3. Guess what color the text is?
Answer:
A: red
B: blue
Which one do you choose?
| The code is as follows: |
Copy code |
<Style>
. Red {color: red}
. Blue {color: blue}
</Style>
</Head>
<Body class = "blue red">
|
Think about the color of text?
</Body>
4. Guess what color the text is?
Answer:
A: red
B: blue
Which one do you choose?
| The code is as follows: |
Copy code |
<Style>
. Blue {color: blue}
. Red {color: red}
</Style>
</Head>
<Body class = "red blue">
|
Think about the color of text?
</Body>
5. What will happen to this black stripe?
Answer:
A: 200px is empty on the right;
B: full screen width;
Which one do you choose?
| The code is as follows: |
Copy code |
<Style>
# Webjx {width: 100%; margin-left: 200px; background: #000}
</Style>
<Body>
<Div id = "webjx"> What about this black bar? </Div>
</Body>
|
6. What will happen to this black stripe?
Answer:
A: 200px is empty on the left;
B: full screen width;
Which one do you choose?
| The code is as follows: |
Copy code |
<Style>
# Webjx {width: 100%; margin-right:-200px; background: #000}
</Style>
<Body>
<Div id = "webjx"> What about this black bar? </Div>
</Body>
|