Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the classical knowledge of HTML and CSS

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "what is the classic knowledge of HTML and CSS", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let Xiaobian take you to learn "What are the classic knowledge of HTML and CSS"!

margin and padding properties--------

align and float properties--------

text-align and vertical-align------------

Margins outside elements, padding inside elements

1. margin style single margin This property handles the spacing outside the element

Margins can be set to specific lengths (pixels, points, ems) or percentages. If percentage, percentage is based on the entire page rather than the element size (margin-left=25%, meaning the left margin of the element will be 25% of the entire page width)

margin-top;margin-right;margin-bottom;margin-left are the width values of the top, right, bottom, and left borders, respectively

2. padding Add space inside a rectangular area of an element

3.border-width Defines the width of four borders:

border-width:border-top-width border-right-width border-bottom-width border-left-width; width values of the top, right, bottom and left borders, respectively

4. The text-align style aligns its elements horizontally within its bounding area

The vertical-align attribute aligns elements vertically. Specifies how an element is aligned with its parent (and in some cases, with the current row of elements in the page). "Current row" refers to the vertical position of the element displayed within the element, in other words, inline elements.

property values

top: Align the top of an element with the current row

middle: aligns the center of an element with the current row

bottom: Align the bottom of an element with the current row

text-top: aligns the top of an element with the top of the parent element

baseline: aligns the baseline of an element with the baseline of the parent element

text-bottom: aligns the bottom of an element with the bottom of the parent element

The float attribute enables elements to move around the design, allowing other elements to surround them. The float of an element is horizontal rather than vertical, and there are only two possible values: right and left. With these two values, the float element will float as far to the right or left as the container element allows.

7. Clear property clears floating elements

Left,right,both,none ,inherit

8. box model

margin--> border--> padding--> content

HTML and CSS Introduction Classic Notes

9. Position attribute Positioning type

relative: relative positioning, default positioning type. The arrangement of pieces on a chessboard: the pieces are arranged from left to right, moving to the next row when they reach the edge. The way the pieces are arranged is determined by the display.

Elements with a value of block for the style attribute display are automatically placed on the next line (default), while elements with an inline value are automatically placed on the same line, after the previous element

absolute: absolute positioning, able to specify the position of the element's rectangular locality relative to the parent element's region

Attribute Value:

left: Position offset on the left

right: offset to the right

top: Position offset of top

bottom: Position offset of bottom

The z-index attribute controls the stacking order of elements. Elements with higher z-index values are above elements with lower z-index values

11. Text flow (i.e. content flow) controls the following style attributes:

float: Determines how text wraps around an elementCan be set to left or rightIf you set the float property of an image to left, the image will be placed to the left of the text

clear: Prevent text from wrapping around the element

overflow: Controls how text overflows when the element is too small to contain all text, set to visible,hidden,scroll

At this point, I believe that everyone has a deeper understanding of "HTML and CSS classic knowledge," may wish to actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 221

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report