Html + css basics, htmlcss
Complete HTML Structure
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Title> </title>
</Head>
<Body>
</Body>
</Html>
Style reference
I. Write internally
<Head>
<Title> </title>
<Style type = "text/css">
Body {background: black; text-spacing: 0.5em}
. Div_css1 {align = "center" margin: 20px}
. P_css1 {color: red; font :( Style) itlic | oblique (variant) small-caps | none (weight) 800 (400 = norml 700 = bold) (size) 4em (family) "" | Times New Norman}
</Style>
<Div class = "">
(If ues: so use the style just 1 times )!!!
# Div_css {}
<Div id = "">
(Or ues: so don't write "class or id =? ")
Div. p {}
Div p {}
II. External Reference
<Link rel = "stylesheet" type = "text/css" href = "xx.css">
Hyperlink Style
A {} // all super links
A: link {} // no linked links
A: visited {} // alredy linked links
A: hover {} // on mose move to the link
A: action {} // when you click
Insert a flash file
<Object type = "application/x-shockwave-flash" date = "//" width = "" height = "" id = ">
<Param name = "movie" value = "//"/>
<Param name = "allowscriptAcess" value = "sameDomain"/>
<Param name = "quality" value = "best"/>
<Param name = "bgcolor" value = "# FFFFFF"/>
<Param name = "scale" value = "noScale"/>
<Param name = "salign" calue = "TL"/>
<Param name = "FlashVars" value = "playerMode = embedded"/>
</Object>
Insert video
<Object type = "video/x-ms-wmv" date = "// xx" width = "" height = "">
<Param name = "src" value = "// xx"/>
<Param name = "autostart" value = "true"/>
<Param name = "controller" value = "true"/>
</Object>
Insert webpage Blocks
<Iframe
Src = "xx"
Width = ""
Height = ""
Scrolling = "auto"
Frameborder = "o"
Name = "xx">
</Iframe>
Insert Form
<Form action = "#" name = "" id = "" method = "post"> </form>
I. Text input (account, password)
Account <input type = "text" name = "" id = "" maxlenth = ""/>
Password <input type = "password" name = "" id = "" maxlenth = ""/>
II. Submit Form
<Input type = "submit" name = "" id = "" value = "OK"> </input>
3. Single choice
<Input type = "radio" name = "" id = "" value = "xx"> xx </input>
<Input type = "radio" name = "" id = "" value = "xx"> xx </input>
4. Multiple choice
<Input type = "checkbox" name = "" id = "" vslue = "xx"> xx </input>
<Input type = "checkbox" name = "" id = "" vslue = "xx"> xx </input>
<Input type = "checkbox" name = "" id = "" vslue = "xx"> xx </input>
5. Drop-down menu
<Select name = "" id = "">
<Option vslue = "xx"> xx </option>
<Option vslue = "xx"> xx </option>
<Option vslue = "xx"> xx </option>
</Select>
Sat. List (no drop-down)
<Select name = "" id = "" size = "count">
<Option value = ""> xx </optin>
.......
......
</Select>
Floating text box
<Fieldset>
<Legend> xx </legend>
</Fieldset>
Scroll text
<Maquee direction = "up | left" scrollamount = "0-x" onmouseover = "stop ()" onmouseout = "start ()">
Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
</Marquee>
Table
<Table>
<Tr>
<Td> xx </td>
</Tr>
<Tr>
<Td colspan = "num"> xx </td> // merge the horizontal
<Td rowspan = "num"> xx </td> // merge the vertical
</Tr>
</Table>
Text attributes
Set text attributes of Element Content
(1) set the indent of the first line of text
Text-indent: 2em;
(2) setting text alignment
Text-align: left | right | center;
(3) set text Modifier
Text-decoration: underline;
(4) set the padding
Letter-spacing: 2em;
(5) set the word spacing
Word-spacing: 0.5em;
(6) Example: blank display format P56
White-space: pre;
Margin: Optional area outside the element border.
Padding: an optional area between the text content and the border
Element floating
Floating:
Float
There are two directions: left right none (not floating)
For text float, the height and width must be set. If not set, the result is at your own risk.
Example
position: absolute;
Absolute positioning: relative to the parent element (included container ).
Position: relative;
Relative positioning: relative to the normal location when no position is set
The original space is retained. (That is to say, there will be no other tag in the place calculated by the static position. Such as DIV and IMG .)
Example:
<Head>
<Style type = "text/css">
. Div_1 {width: 150px; height: 200px ;}
. Text1 {width: 200px; height: 100px; left: 160px ;}
</Style>
</Head>
<Body>
<Div>
<Div class = "div_1"> explanation: "Ha, I am a handsome guy" uses absolute for absolute positioning, which is located relative to the first DIV, because the first DIV is its parent element and contains it. So it appears at the top. (Because left and top are not set for it)
"No, I am dizzy" is also absolute positioning. relative to the first DIV positioning, it sets the left value to 160px, which is greater than the width of the previous div, so it will not overlap.
"I can't see it." relative is used for relative positioning. It is located relative to the parent element, that is, the first DIV. Its positioning position starts from the first position in the parent element, therefore, if top is not set, it will overlap with the second div. The font size is generally 15px'
Specify the Cropping Area
Position: absolute;
Clip: rect (top right bottom left );
Top: the length of top from top to bottom.
Left: the length of left from left to right.
Right: returns the length of right from left to right.
Bottom: Specifies the length of a bottom from top to bottom.
Converting block-level elements into character-level elements
Display: inline;
Converts a character-level element to a block-level element.
Display: block;
Handle Overflow
Position: absolute; (must be absolute)
Overflow: visible; // visible in the overflow area
Overflow: hidden; // The overflow area is invisible.
Overflow: scroll; // scroll bar appears in the overflow area
Box Model
With margin padding border width height
Write in the upper-right and lower-left order.
Example: border-width: 1em 2em 2em 2em
Note: These attributes are as follows:
If only three values appear during the setting, the upper, lower, and lower
Two values: upper, lower, and lower
1 Value: All = four identical values
Insert multimedia
<Embed src = "1.swf" width = 300 height = 200> </embed>
<Embed src = "1.mp3" width = 300 height = 200> </embed>
<Embed src = "1.wmv" width = 300 height = 200> </embed>
Reprinted
[HTML/CSS] beginner's Guide
<! DOCTYPE html>
How long should I learn html basic div + css?
I want to know how much I learned. If I only have simple theoretical knowledge and basic webpage layout, I can learn it every day for 2-3 hours a week. If I want to learn and practice, this will take time
For a longer time, because the theoretical knowledge you learn seems very simple, but you may encounter unexpected problems in the actual operation process. In this case, it takes at least one time. However, if you want
Learn more in detail. The accuracy of web page layout, color matching, browser compatibility, and processing of some images will involve PS. You will be able to exercise in practice in the future!
If you only want to understand DIV + CSS, rather than professional webpage design, it is very simple and can be learned in a few days!