Here at HubSpot we often recommendusing your corporate blog to answer questions for your customers.最近,我们一直在接受自己的建议,并使用HubSpot Inbound Marketing Blog来解决人们在呼吁HubSpot的销售和服务代表时提出的问题。

Today’s question: What is CSS?

This is one we get a lot. It’s one of those things where a lot of people have heard the initials but most don’t know what they stand for. Out of the 7 billion people on the planet, we’re guessing that 6.999 billion don’t know what CSS is.

Once you do know what CSS is, you may discover that you actually don’t need to know what it is, because you’ll never have to deal with it -- you have designers or agencies that are handling your CSS needs. But we get it. You’re curious. Knowledge is power. And it's good to be well versed in the language your designers and agencies use. So here goes.

Download Now: Free Intro Guide to HTML & CSS

What is CSS?

CSS代表级联风格的表。基本上,CSS是一种管理网页的设计和显示的语言 - 事物的外观。它与HTML或Hypertext标记语言一起工作,该语言处理网页的内容。

With CSS you can create rules to tell your website how you want it to display information. And you can keep the commands for the style stuff -- fonts, colors, and so on -- separate from the commands for the content.

They’re called “cascading” because you can have multiple style sheets, with one style sheet inheriting properties (or “cascading”) from others.

对于很多人来说,普通的旧博客模板就足够了。只有当您想开始自定义网站外观时,您需要深入研究CSS。

三个样式的床单

CSS样式表有三种:外部,内部和内联。

External样式控制着网站上许多页面的外观。

Internalstyles control the look of just one page.

Inlinestyles control just one element of a single page, even just a single word.

For more info on how these style sheets work together or “cascade” into one another, see thisgreat tutorialfrom w3schools.com.

Put simply, you can use multiple style sheets, and they will know how to defer to one another. Basically,排队overrides内部的,internaloverridesexternal.

According to thisCSS tutorial,最好主要依靠externalstyles, and避免一次性的东西越多越好。

You write out CSS commands and create a style sheet using a text editor. Then you link that style sheet to your HTML, and, voila, your site will now obey the rules you’ve set forth in the CSS style sheet.

还有很多比所能覆盖的CSSin a blog post. For example, as with any language, there’s a syntax that you have to learn, and we can’t cover that here. But if you're itching to get started ...

Just Enough to Be Dangerous

CSS code looks kind of weird at first glance. To give you an idea what it looks like, we've cribbed an example from aMashable article on CSS.Take a look:

答:链接{颜色:红色;}
a:visited {color:purple;}

Translation:一个未访问的链接将以红色出现,访问的链接将是紫色的。

But it's not as techie as it seems. And again, a lot of people don’t ever need to touch CSS. However, if you do want to do some customization, you’ll need to come up to speed on CSS. If so, your best bet is to buy a book like这个要赶上速度,然后 - 开始砍掉。您练习的越多,您就会越好,越流利。

图片来源:Stefan Baudy

新的呼吁行动

CSS简介

Originally published Sep 16, 2013 2:00:00 PM, updated February 18 2020

Topics:

Website Development