官术网_书友最值得收藏!

Introduction

Whether you want to create a simple web page to advertise a business, blog about your hobbies and interests, maintain an online community, or even create your own social media network, HTML and CSS are the foundational technologies upon which you can build for the web and are a way for you to get your ideas out there to as wide an audience as possible.

When a web browser navigates to a web page, it will receive and parse an HTML document, which may include text, pictures, links, and other media (for instance, sound and video).

HTML structures this content. It gives it context, describes the content and tells the browser what to do with it. CSS tells the browser how to present the content. A set of styling rules lets the browser know how to render elements within the HTML document. HTML and CSS together give the browser the information it needs to render the web page for the user.

Navigate to a website and what you see is the rendered output of content marked up with HTML and styled with CSS. As a browser user, you have access to the source code of a web page. In Chrome, for example, you can view a page's source code with the keyboard shortcut Ctrl + U on a PC or Cmd + U on a Mac, or right-click and choose View Page Source. Try it yourself. As an example, the following two figures show what the Packt website's Web Development portal looks like when rendered in the browser and as source code respectively.

Ultimately, by learning how to write the HTML and CSS found in that source code, we can create a modern website:

Figure 1.1: The Packt Publishing site's Web Development portal

The following figure shows the source code of the Packt website:

Figure 1.2: The HTML source code of the Packt site

In this chapter, we will look at how a web page renders by following the process from initial request to completed composition. We will create our first web page and look at how a web browser will parse HTML and CSS to render that page. We will look at how browser developer tools, such as those included with the Chrome browser, can help us to identify and edit nodes within an HTML document and the CSS applied to those nodes.

主站蜘蛛池模板: 珲春市| 巍山| 丹阳市| 琼结县| 普宁市| 蓬溪县| 建瓯市| 榆中县| 公安县| 平罗县| 广丰县| 西乡县| 独山县| 阿巴嘎旗| 富顺县| 鄂尔多斯市| 九龙坡区| 巧家县| 赫章县| 和硕县| 竹北市| 法库县| 闵行区| 宁波市| 南安市| 广德县| 隆回县| 贵港市| 丰镇市| 乡宁县| 武安市| 榆中县| 夏津县| 青州市| 昆山市| 松滋市| 密山市| 无极县| 雷山县| 涪陵区| 新乐市|