Common css skills [continuously updated]_html/css_WEB-ITnose
1. Horizontal scroll bar removal
demo:
Code analysis:
Vertically displayed normally, horizontal overflow hidden.
2. About background tiling (100% display)
demo:
.outer {width:100%;background:url() no-repeat center top;}
. core {width:1000px; margin:auto;}
Code analysis:
Double-layer div nesting, the outer div sets the width to 100%, no-repeat background does not repeat, the scaling base point of the center background image is in the middle , the top is displayed from top to bottom; the inner div is set to a fixed width, and the margin is automatically [displayed in the center].
3. Position and z-index
demo: The
layer is covered and cannot be displayed normally.
Problem analysis:
Set the position and z-index of the div. Details: POSITION and Z-INDEX
4. Remove the dotted border of the hyperlink
deme:
After clicking the hyperlink, a dotted border
appears Code analysis:
IE browser: a {blr:expression(this.onFocus=this.blur());}
FF browser: a {outline: none;} or narrow the range: a:focus { outline: none; } Note: The latter makes the mouse Press the left button on the link and during the period before releasing it, the dotted outline will still be displayed.
5. Add to favorites (concise code)
demo:
Upper right corner: Add Collection
Code analysis:
Add to favorites
6. The div uses float to overflow fatherdiv
demo:
Fdiv does not set the height, the div uses float, and the content overflows.
Solution:
Add Bdiv and apply clear: both to clear float or set height to Fdiv.
7. CSS abbreviation rules
① Abbreviation of color
demo:
#ff00ee->#f0e Simple abbreviation Note: #f0f0fe->#f0f0fe cannot be abbreviated
②, the abbreviation of the unit
The value is 0, you don’t need to write the unit
demo:
margin: 0px->margin: 0
③, the abbreviation of margin and padding
Describe the rules , clockwise up, right, bottom left
demo:
margin-left: 15px; margin-right: 20px; margin-top: 30px; margin-buttom: 10px; -->
margin: 30px 20px 10px 15px; top=30px, right=20px, bottom=10px, left=15px;
margin: 30px; top=right=bottom=left=30px;
margin: 30px 20px; top=bottom=30px; Left = right = 20px;
margin: 30px 10px 15px; top = 30px; bottom = 10px; left = right = 15px;
Note: top, right, bottom, left and clockwise are not only applicable here
④, Abbreviation of border
Rules: border: border-width border-style border-color
demo:
div {border-width: 1px; border-style: solid; border-color: #f00;}/ *Border width, border style, border color*/
->div {border: 1px solid #f00;}
Border-top, border-right, border-buttom, border-left cannot be abbreviated, but they can:
div{ border-width: 1px; /* The border width in all four directions of the border is 1px*/
border-style: solid dashed double; /* Upper border: solid; Lower border: dashed; Left and right borders: double; */
border-color: #f00 #000; /*Top and bottom border colors: #f00; Left and right border colors: #00*/
}

Hot AI Tools

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

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

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

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

In Vue.js, the placeholder attribute specifies the placeholder text of the input element, which is displayed when the user has not entered content, provides input tips or examples, and improves form accessibility. Its usage is to set the placeholder attribute on the input element and customize the appearance using CSS. Best practices include being relevant to the input, being short and clear, avoiding default text, and considering accessibility.

A friend's computer has such a fault. When opening "This PC" and the C drive file, it will prompt "Explorer.EXE Windows cannot access the specified device, path or file. You may not have the appropriate permissions to access the project." Including folders, files, This computer, Recycle Bin, etc., double-clicking will pop up such a window, and right-clicking to open it is normal. This is caused by a system update. If you also encounter this situation, the editor below will teach you how to solve it. 1. Open the registry editor Win+R and enter regedit, or right-click the start menu to run and enter regedit; 2. Locate the registry "Computer\HKEY_CLASSES_ROOT\PackagedCom\ClassInd"

The span tag can add styles, attributes, or behaviors to text. It is used to: add styles, such as color and font size. Set attributes such as id, class, etc. Associated behaviors such as clicks, hovers, etc. Mark text for further processing or citation.

Windows updates may cause some of the following problems: 1. Compatibility issues: Some applications, drivers, or hardware devices may be incompatible with new Windows updates, causing them to not work properly or crash. 2. Performance issues: Sometimes, Windows updates may cause the system to become slower or experience performance degradation. This may be due to new features or improvements requiring more resources to run. 3. System stability issues: Some users reported that after installing Windows updates, the system may experience unexpected crashes or blue screen errors. 4. Data loss: In rare cases, Windows updates may cause data loss or file corruption. This is why before making any important updates, back up your

REM in CSS is a relative unit relative to the font size of the root element (html). It has the following characteristics: relative to the root element font size, not affected by the parent element. When the root element's font size changes, elements using REM will adjust accordingly. Can be used with any CSS property. Advantages of using REM include: Responsiveness: Keep text readable on different devices and screen sizes. Consistency: Make sure font sizes are consistent throughout your website. Scalability: Easily change the global font size by adjusting the root element font size.

There are five ways to introduce images in Vue: through URL, require function, static file, v-bind directive and CSS background image. Dynamic images can be handled in Vue's computed properties or listeners, and bundled tools can be used to optimize image loading. Make sure the path is correct otherwise a loading error will appear.

According to news from this site on May 3, MSI today released the AMDAM4AGESA1.2.0.Ca firmware update, which fixes the Zenbleed security vulnerability in the AMD Ryzen4000 series Zen2 APU. The firmware update released by MSI this time is suitable for almost all X570 motherboards. It mainly fixes CVE-2023-20593 for Zen2 processors, which AMD classifies as a medium threat. Note from this site: The vulnerability tracking number is CVE-2023-20593, which can steal confidential data at a speed of 30KB per core per second. This attack affects all software running on the CPU, including virtual machines, sandboxes, containers and processes. Although the purpose of AGESA1.2.0.Ca

Browser plug-ins are usually written in the following languages: Front-end languages: JavaScript, HTML, CSS Back-end languages: C++, Rust, WebAssembly Other languages: Python, Java
