


DIV CSS commonly used attributes, parameters and descriptions_Experience exchange
May 16, 2016 pm 12:04 PMGeneral class
overflow:hidden; automatically hides excess content to prevent expanding the scope of layers and tables
!important
Specifies the application priority of style rules
Text class color: #FF0000;Text color font-family: "Arial", "Helvetica", "sans-serif"; font-size: 9px; font size text-align: center; center (left means left, right means right) line-height: 28px; High (available 150% value) font-style: italic; italic (oblique slant) font-weight: bold; service bold (bolder extra bold, 400 bold value) font-variant: small-caps; small caps text- transform: capitalize; text-decoration: underline overline line-through blink; underline, overline, strikethrough, blink text-indent: 2em; text indent 2 font height (or 15px, that is, 15 pixels)
Background class background-attachment: fixed; fixed position (scroll) background: #0066CC; background color (transparent) background: url(/image/more2.gif); background image background-repeat: repeat; repeat ( repeat-x repeats horizontally, repeat-y repeats vertically) background-position: center top; horizontal center vertical top (left center horizontal center left vertical center) background: url(/image/dtbg.gif) #FEFEFE
no-repeat
Right bottom (2px 5px);
Background image,
Background color, the image does not repeat, the background image starts from the lower right corner (the image is 2px from the left and 5px from the top)
Frame position class
clear: both; reject floating objects on both sides (left rejects floating objects, right rejects floating objects)
float: left; floating objects are positioned on the left (right, the latest train schedule is on the right)
position :relative; Relative position, usually set the best timetable in the superior frame
Position: absolute; Absolute position, set the top and left values ????for this level frame in conjunction with the settings of the superior frame
top: 5px; Absolute position of the page or relative to the top of the frame
Left: 10px; Absolute position of the page absolute or relative to the left side of the frame
Width: 100px; 100px wide
Height: 200px; 200px high (auto and 100% values ??available) )
Margin Shanghai train timetable: 10px 20px 10px 20px;
Top, right, bottom and left margins (if the values ??are the same, margin: 10px can be omitted)
Specify margin-top separately: 10px; (margin- right, margin-bottom, margin-left)
Padding: 20px 10px 10px 20p;
The distance between the top, right, bottom and left content from the border (the same value can omit padding: 10px)
Use padding- when specified individually top: 10px; (padding-right, padding-bottompadding-left)
Border: #ccc 1px solid Chengdu train timetable;
Four border colors, line width, solid lines (dotted dashed line, dashed dotted line, double Double line, ridge (ridge)
Separately specify border-top: #ccc 1px solid; border-right: #ccc 1px solid
Wait
Item list class list-style-position: outside; position For outside (inside) list-style-image: url(/yh/image/more04.gif); bullet image Linke timetable list-style-type: disc; bullets are dots (circle circle, square)
Extended class cursor: e-resize; mouse style filter: Blur(Add=4 , Direction=8, Strength=4); filter filter: FlipH; horizontal flip (FlipV gprs traffic fee vertical flip)
Set the link separately
#bottool a:link{color:#fff}; Unvisited Color
#bottool a:visited{color:#fff};Visited color flow software
#bottool a:hover{color:#ff0};The mouse is on the link
There are so many definition items, in fact Commonly used are the following categories: specify width and height value width, height; specify background: background; specify position: float, specially use position combined with top and left to position; set frame margin: margin; set inner frame distance of container : Padding several items. Among them, the definition items of overflow, clear, and !important programs were canceled in my style definition. 1. Cancel overflow:hidden because after repeated experiments, this definition item can only hide content that exceeds the height of the container but cannot hide content that exceeds the width. What I need is to be able to automatically hide content that exceeds the width of the container. Sometimes I need the height of the container to expand according to the amount of content. 2. The reason for canceling the clear definition is that in actual applications, the arrangement relationship between containers is truly understood. The position of the frame or container is still accurately positioned using float, position, top, left, etc. 3. !important
Specifies the application priority of style rules. This is mainly used to distinguish the display effect between IE and other browsers. My website just wants to fix the display effect, so there is no priority.
I am still researching DIV CSS. If there are any inappropriate points, please post and correct them. If there are any improvements, please post them and improve them. I think the most important thing when using DIV CSS to layout a website is the layout idea. Different design plans have very different traditional and simplified designs. I focus on the universality of the framework or container, and design several container styles, just like the label style in FS4, and then just call this style where needed to achieve universality rather than specificity. Let’s talk about these today, and we will talk specifically about this layout design idea later.

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

CSS blocks page rendering because browsers view inline and external CSS as key resources by default, especially with imported stylesheets, header large amounts of inline CSS, and unoptimized media query styles. 1. Extract critical CSS and embed it into HTML; 2. Delay loading non-critical CSS through JavaScript; 3. Use media attributes to optimize loading such as print styles; 4. Compress and merge CSS to reduce requests. It is recommended to use tools to extract key CSS, combine rel="preload" asynchronous loading, and use media delayed loading reasonably to avoid excessive splitting and complex script control.

Autoprefixer is a tool that automatically adds vendor prefixes to CSS attributes based on the target browser scope. 1. It solves the problem of manually maintaining prefixes with errors; 2. Work through the PostCSS plug-in form, parse CSS, analyze attributes that need to be prefixed, and generate code according to configuration; 3. The usage steps include installing plug-ins, setting browserslist, and enabling them in the build process; 4. Notes include not manually adding prefixes, keeping configuration updates, prefixes not all attributes, and it is recommended to use them with the preprocessor.

Choosing the correct display value in CSS is crucial because it controls the behavior of elements in the layout. 1.inline: Make elements flow like text, without occupying a single line, and cannot directly set width and height, suitable for elements in text, such as; 2.block: Make elements exclusively occupy one line and occupy all width, can set width and height and inner and outer margins, suitable for structured elements, such as; 3.inline-block: has both block characteristics and inline layout, can set size but still display in the same line, suitable for horizontal layouts that require consistent spacing; 4.flex: Modern layout mode, suitable for containers, easy to achieve alignment and distribution through justify-content, align-items and other attributes, yes

AnimatingSVGwithCSSispossibleusingkeyframesforbasicanimationsandtransitionsforinteractiveeffects.1.Use@keyframestodefineanimationstagesforpropertieslikescale,opacity,andcolor.2.ApplytheanimationtoSVGelementssuchas,,orviaCSSclasses.3.Forhoverorstate-b

Parameters are placeholders when defining a function, while arguments are specific values ??passed in when calling. 1. Position parameters need to be passed in order, and incorrect order will lead to errors in the result; 2. Keyword parameters are specified by parameter names, which can change the order and improve readability; 3. Default parameter values ??are assigned when defined to avoid duplicate code, but variable objects should be avoided as default values; 4. args and *kwargs can handle uncertain number of parameters and are suitable for general interfaces or decorators, but should be used with caution to maintain readability.

Theconic-gradient()functioninCSScreatescirculargradientsthatrotatecolorstopsaroundacentralpoint.1.Itisidealforpiecharts,progressindicators,colorwheels,anddecorativebackgrounds.2.Itworksbydefiningcolorstopsatspecificangles,optionallystartingfromadefin

The scope of CSS custom properties depends on the context of their declaration, global variables are usually defined in :root, while local variables are defined within a specific selector for componentization and isolation of styles. For example, variables defined in the .card class are only available for elements that match the class and their children. Best practices include: 1. Use: root to define global variables such as topic color; 2. Define local variables inside the component to implement encapsulation; 3. Avoid repeatedly declaring the same variable; 4. Pay attention to the coverage problems that may be caused by selector specificity. Additionally, CSS variables are case sensitive and should be defined before use to avoid errors. If the variable is undefined or the reference fails, the fallback value or default value initial will be used. Debug can be done through the browser developer

Mobile-firstCSSdesignrequiressettingtheviewportmetatag,usingrelativeunits,stylingfromsmallscreensup,optimizingtypographyandtouchtargets.First,addtocontrolscaling.Second,use%,em,orreminsteadofpixelsforflexiblelayouts.Third,writebasestylesformobile,the
