:HTML Basic Attributes and CSS Basics-empirical point of view免费ppt模版下载-道格办公

HTML Basic Attributes and CSS Basics

Grid separation. 2.id attribute: used to define the unique identifier of the element, which can be used to select specific elements through JavaScript or CSS. 3. style attribute: used to define inline styles for elements, used directly inside element tags

Choose one out of ten thousand hairy and interesting coders~

40

Uncle You | A programmer with a story


1
HTML basic attributes

1.class attribute: is used to define the class name of the element, if you need to specify multiple classes for an element, separate the class names with spaces
definition format : <p class='class name'></p >


2.name attribute: is used to specify the name of the label element. The value of the Name attribute can be a string enclosed in quotation marks, but the string must be unique
Define the format: <a name=”the name of the element”>


3. id attribute: The value of the id attribute can be a string enclosed in quotation marks, but the string must be unique
Definition format: <a id="element ID value">


Example:



3.style attribute: Indicates the style of the element, including:
background color background
width width
height height
font color color
font family font -family: Song typeface and the like
font style font-style: bold, italic
font size font-size
font alignment text-align

Example :


Results:

2
CSS Basics

Introduction: < br>
CSS means cascading style sheets (cascading style sheets), which is used to standardize the style attributes of the text on the page. The effect is the same as the attributes in the HTML tags. The difference is that if the HTML tag attributes change, they need to be modified one by one. Each label; the function of CSS is to modify the CSS file, and the attribute value of the same label can be modified at one time.

Syntax of CSS:

Selector {attribute value}

Example: p {color:red;font-size:40} Among them p paragraph, the content inside {} means to set the color and text size of the font of the paragraph, and finally name the file as .css format

CSS style reference:

Add <link rel='stylesheet' style='text/css' href='h1.css'>

where: rel=' stylesheet' means referring to an external style sheet; style='text/css' means the type of style sheet; href='h1.css' means the name of the style sheet

Example:

Use <p> paragraph tags to define text attributes:


Use the CSS style file to uniformly define the text attributes of the paragraph:

 




Articles are uploaded by users and are for non-commercial browsing only. Posted by: Lomu, please indicate the source: https://www.daogebangong.com/en/articles/detail/HTML%20Basic%20Attributes%20and%20CSS%20Basics.html

Like (810)
Reward 支付宝扫一扫 支付宝扫一扫
single-end

Related Suggestion