Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS概念 #31

Open
yankewei opened this issue May 27, 2020 · 0 comments
Open

CSS概念 #31

yankewei opened this issue May 27, 2020 · 0 comments
Labels

Comments

@yankewei
Copy link
Owner

总觉得CSS难学,还复杂,其实我觉得是对CSS的相关概念不清晰,导致出现错位,样式不生效等问题。

继承

继承这个概念,在后端非常的常见,继承类之后,子类可以拥有父类的属性、方法。
在CSS中也有继承的概念,只不过这个继承是说的自己的样式。如果当前的元素没有设置样式(ID、类、元素),那么就会从父元素那里继承过来。当然并不是所有的属性都会继承,color、font-size等这些会被继承,border、padding这些不会被继承。要判断是否有继承,一般情况下符合生活的,如果border被继承的话,页面会很糟糕。

@yankewei yankewei added the CSS label May 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant