Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

HTML CSS Encyclouser and commonly used embedding methods


May 02, 2021 HTML


Table of contents


HTML Style - CSS

Cascading Style Sheet translates as a Cascade Style Sheet or Cascading Style Sheet, which defines how HTML elements are displayed to control the appearance of Web pages. T he use of CSS to separate the content and representation of a page greatly improves productivity. S tyles are stored in style sheets, usually in the slt;head, or in an external CSS file. As a trend of web page standardized design, CSS has obtained wide support from browser manufacturers and is increasingly being applied to web design.

The new standard for web pages now is W3C. T he current pattern is Html and Css and Javascript, and how do you understand that Html is the structure of a Web page, CSS is the style of a Web page, and Javascript is behavior. S tructure is to build a house first to build the structure, and then with CSS to decorate. In fact, when you use Dreamweaver as a web page, you have already used CSS, for example, you use DW's property panel to set the font, color and size of a word, when you choose, will automatically generate a .style1 red code, in the slt;style and gt;

CSS (Cascading Style Sheets) is used to render HTML element labels.

Look! Styles and colors

Manipulate Text
Colors, Boxes
and more...



HTML CSS Encyclouser and commonly used embedding methods

Try it - instance

HTML uses styles
This example shows how to format HTML using the style information added to the section.

This example shows how to use style properties to make an unlined link.
How to use the style property to make an unlined link.

Link to an external style sheet
This example shows how a label is linked to an external style sheet.


How to use CSS

CSS was introduced in HTML 4 to better render HTML elements.

CSS can be added to HTML in the following ways:

  • Inline style - Use the "style" property in HTML elements
  • Internal Style Sheets - Use the element of the HTML document head to include CSS
  • External Reference - Use an external CSS file

The best way is to refer to the CSS file externally.

In our HTML tutorial on this site, we used inline CSS styles to introduce examples, which is to simplify the example and make it easier for you to edit the code online and run the instance online.

You can learn more about CSS through the CSS tutorial CSS tutorial on this site, or you can learn more about CSS micro-lessons that are easier to understand .


Inline style

When a particular style needs to be applied to an individual element, you can use an inline style, and you can define an internal style sheet in the section on the label. T he way to use inline styles is to use style properties in related labels. S tyle properties can contain any CSS property. The following example shows how to change the color of a paragraph.

Example

<head>

<style type="text/css">

body {background-color:yellow;}

p {color:blue;}

</style>

</head>

To learn more about styles, visit the CSS tutorial .


HTML Style Instance - Background color

The background-color property defines the background color of an element:

Example

<!DOCTYPE html>
<html>
<body style="background-color:yellow;">
<h2 style="background-color:red;">This is a heading</h2>
<p style="background-color:green;">This is a paragraph.</p>
</body>
</html>

Try it out . . .

Early background-color properties were defined using the bgcolor property.

Try it: Older HTML to set the background


HTML Style Instance - Font, Font Color, Font Size

We can use font-family (font), color (color), and font-size properties to define the style of the font:

<!DOCTYPE html>
<html>
<body>
<h1 style="font-family:verdana;">A heading</h1>
<p style="font-family:arial;color:red;font-size:20px;">A paragraph.</p>
</body>
</html>

Try it out . . .

Text styles are now typically defined using font-family (font), color(color), and font-size (font size) properties, rather than using the hashtags.


HTML Style Instance - Text alignment

Use the text-align property to specify the horizontal and vertical alignment of text:

<!DOCTYPE html>
<html>
<body>
<h1 style="text-align:center;">Center-aligned heading</h1>
<p>This is a paragraph.</p>
</body>
</html>

Try it out . . .

The text-alignment property text-align replaces the old label, slt;center.

Give it a try


The internal style sheet

Internal style sheets can be used when a single file requires a special style. You can define an internal style sheet in the section on the label:

<head>

<style type="text/css">

body {background-color:yellow;}

p {color:blue;}

</style>

</head>


Try it out . . .

The external style sheet

External style sheets are ideal when styles need to be applied to many pages. With an external style sheet, you can change the appearance of the entire site by changing a file.

<head>

<link rel="stylesheet" type="text/css" href="mystyle.css">

</head>


HTML style tags

Label describe
<style> Define text style
<link> Define the resource reference address


Deprecated labels and properties

In HTML 4, tags and properties that originally supported defining HTML element styles have been deprecated. These labels will not support the new version of HTML tags.

Labels that are not recommended are: slt;font>, slt;center>, slt;strike>

Not recommended properties: color and bgcolor.


Learn the book recommendations for HTML and CSS

1, "CSS Those Things"
HTML CSS Encyclouser and commonly used embedding methods
Focusing on examples of CSS techniques, this book provides an in-depth analysis of the principles that CSS styles need to understand when layout. B ypassing the basics that can be found everywhere, the hack skills that can be searched freely in the network, focusing on principle analysis, expanding the way readers think about using CSS layouts, readers of this book will learn about the power of using CSS layouts.

The book is centered on communicating CSS layout thinking, and through the processing of common elements such as text, pictures, tables, forms, and the use of various page layout methods, readers can gain insight into how to better use CSS layout in the page. E specially in the part of page layout, a comprehensive analysis of a variety of layout methods, focusing on the decomposition of two columns of equal height and three columns of several ways, and correspondingly explained the advantages and disadvantages of such a high layout.

Whether it's a beginner with a CSS layout or a reader with a certain level, reading this book will reveal that the original CSS style is such a fun thing. T his book is suitable for website developers, web designers reference learning, but also suitable for the relevant training institutions as a teaching material.


2、《 Head First HTML and CSS 2nd Edition 》
《 Head First HTML5 》
Both books should have translations, but it is recommended to look at the original


3, "Eric Meyer on CSS" (up and down volume)
HTML CSS Encyclouser and commonly used embedding methods
Eric Meyer on CSS (Volume 1) brings together the valuable CSS hands-on experience of world-class expert Eric Meyer, using 13 typical real-world projects to guide readers on how to use CSS to solve real-world problems. I tems include converting existing pages, styling news pages, setting calendar styles, setting menu styles, creating print style multi-column layouts, and more.


4, "CSS Zen Garden"
HTML CSS Encyclouser and commonly used embedding methods
The author of the book is a world-renowned web designer, and its examples come from CSS Zen Garden, the most famous site in the field of website design. T he book is divided into two main parts. C hapter 1 is the first part, which discusses the website "CSS Zen Flower" and its most basic themes, including the correct marking structure and flexibility planning. The second part consists of six chapters, which take up most of the book.

Each chapter dissects six design pieces from the CSS Zen Garden, which revolve around a major design concept, such as the use of words. By exploring the challenges and problems faced by 36 design works, readers gain insight into the key web design principles and the CSS layout techniques they use, understand the essence of CSS design, and properly handle graphics and fonts to create a website with a beautiful interface, high performance, and strong vitality.
5, "Proficient in HTML"
HTML CSS Encyclouser and commonly used embedding methods
This book provides an in-depth look at (X)HTML and related technologies, including CSS, microformatts, semantic networks, and more, focusing on how to use the right tags at the right time, and the book always follows modern Web design concepts so that readers can learn how to take advantage of the diversity provided by various tags to create semantically rich and structured websites.

This book is suitable for Web design developers with initial HTML and CSS knowledge.
6. Mastering CSS: Advanced Web Standard Solutions
HTML CSS Encyclouser and commonly used embedding methods
This book brings together the most useful CSS technologies and discusses core CSS technologies such as images, links, list manipulation, form design, data table design, and pure CSS layout after introducing basic CSS concepts and best practices. E ach chapter moved from shallow to deep until more complex examples were built. T he book then discusses tricks, filters, bugs, and bug fixes in two chapters, and concludes with two example studies by Simon Collison and Cameron Moll, two distinguished CSS designers, combining many of the techniques discussed in the book. The book also focuses on real-world browser issues and is an indispensable reference book to compensate for the lack of CSS knowledge.

This book is suitable for any web designer with (X) HTML and CSS basics.


7, "Deep shallow out html"
HTML CSS Encyclouser and commonly used embedding methods
This book is an excellent tutorial on modern web standards, completely discarding outdated content and always implementing the idea of three layers of separation. T he book combines examples of how to use html, css to design web pages that meet modern web standards, and explains how to use javascript to add dynamic behavior. T he main part of the book allows the reader to get in touch with the various topics of html and xhtml, and gradually become familiar with the various elements. The final chapter applies the techniques described in the book, leading the reader to create a useful website step by step.


8. CSS Authoritative Guide (Version 3)
HTML CSS Encyclouser and commonly used embedding methods
Do you want to get rich and complex web styles while saving time and effort? This book shows you how to apply every aspect of cascading style sheets to practice in accordance with the latest CSS specifications (CSS2 and CSS2.1).

With the many examples provided in this book, you'll learn how to create or modify the look and feel of an entire site by creating style sheets in just one place, and how to get richer performance that HTML can't.

Veteran CSS expert Eric A. Meyer. U se his unique wisdom and experience to do in-depth research on attributes, tags, tag properties, and implementations, as well as unique insights on practical issues such as browser support and design principles. All you need is HTML 4.0 knowledge to create concise and easy-to-maintain scripts for site layout and picing, while maintaining the aesthetics and controllability of your desktop system.


9. Website Refactoring (Version 3)
HTML CSS Encyclouser and commonly used embedding methods
Website Refactoring: Designing with Web Standards (Version 3): Best-selling author, designer, and godfather of web standards Jeffrey Zeldman has updated his classic, industry-disrupting guidebook. T his is the third edition of Web Site Refactoring: Designing with Web Standards (Version 3), and this update basically covers the challenges and improvements that come with Web standards as the environment and technology change. Version 3 makes standards-based design clearer and easier to understand, helping you stay smart and ahead of the curve in this area.

As always, Website Refactoring: Applying Web Standards to Design (Version 3) provides more clear insights and new examples to illustrate the core ideas of standards-based design and ultimately determine a reasonable design and development approach for your site.

Unlike the first two editions, in the 3rd edition, in addition to a lot of "why" to ask questions, but also provide a lot of "how" to solve the problem. In addition, in the writing method, the author tries to use witty, attractive writing style, make complex technology easier to understand and digest, help you easily create a fast, low-cost maintenance and development, more users of the website, help you with new technology to adapt the css layout to multiple browsers, make the site content easier to search and access.


10. "Html-css-js Web Production From Getting Started to Mastery"
HTML CSS Encyclouser and commonly used embedding methods
The HTML-CSS-JavaScript Web Production From Getting Started to Mastery is divided into 18 chapters and 4 appendixes that focus on all aspects of web production using HTML, as well as examples of popular Web standards and CSS web page layouts, as well as Web effects production based on the JavaScript language. To make it easier for readers to learn, the appendix brings together more than 60 examples of web-making techniques that have been carefully collated by the author.