Home  >  Article  >  Web Front-end  >  Two questions for beginners to learn HTML_html/css_WEB-ITnose

Two questions for beginners to learn HTML_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:17:071077browse

1:
Change the link color? Does IE have it? Does Firefox have it?

<style type="text/css">a:link{color:blue}a:visited{color:gray}a:hover{color:orange}a:active{color:red}</style></head><body><a href="#" target="_blank">改变链接颜色</a></body>

If you write it like this, the four colors of IE will display normally, but the link of Firefox will be gray at the beginning. Why? Just how to deal with this situation

2:




Doesn’t padding mean to control the distance between the element and the element content? Why is the sentence padding:px added here?
Just make the menu move to the left side of the browser window? Is this true for both FF and IE?
All the code comes from here:
http://www.w3school.com.cn/tiy/t.asp?f=csse_float5


Reply to discussion (solution)

1 Because you have already clicked in IE, it will appear gray in Firefox. I tested opening it with Firefox first and there was no problem.
2 The default element has a certain amount of padding from the edge of the browser. You can remove this distance by setting it to 0px.

1 Because you have already clicked in IE, it will be grayed out in Firefox. I tested opening it with Firefox first and there was no problem.
2 The default element has a certain amount of padding from the edge of the browser. You can remove this distance by setting it to 0px.
1

Correct answer to the 1st floor~~

Clear the lz cache and take another look

Question 1, clear the cache and force refresh again.

Question 2,
margin is the outer spacing, outside the border. The writing method is: margin:10px; 10px spacing for top, bottom, left and right. margin: 5px 10px; top and bottom 5px and left and right 10px;

padding is the inner margin inside the border. The writing method is the same as above.

Wrote one less: margin 1px 2px 3px 4px; use this as top, right, bottom, left

Is programming difficult?

New to learning HTML~~ come here

LZ can go to WC3 to check out the basics first, it’s not bad!

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