Python CSS day1

                                    CSS (appearance)
the -style
  1. Direct <div style = "background-colorblack and white </ div>
  2. In the head to write on <style> div {background-color; color: white} </ stylesuch <div> can be used directly to form a
  3 to create a CSS file in the file, the content is div {background-color: black;so creating html long as the time reference CSS file can directly use the format of the
   <link rel = "stylesheet" hrefpath /) name"> current file do not increase path
  priority: 1> 2> 3 same property overrides, different attributes sequentially reserved
- selector
  a second point 1. above is equivalent to the tag selector
  2. ID selector : find qualified ID, ID can not be repeated in general, but may be selected following repeated
     in the head to write on <style> I1 {background-Color #: Black; Color: White} </ style>
  3. class selector: find all the qualified tag, regardless of where or ID, class, as long as it is in line with the value of c1 is
   <
  3. Level selector: a space to represent one
    example: The following can be set by .c2 div pa {} or .c2 div p .c3 {}, c3 and does not change the last line

            <div class="c2">
                <div></div>
                <div>
                    <p>
                        <a class="c3">a</a>
                    </p>
                </div>
            </div>
            <div class="c3"></div>

  4. Combination selector
    .c1, .c2, .c3 {} is provided with a plurality of

- style base
  1. the width, height:
    width of 100% is not high. Children percentages are based on the size of the parent to inherit
  2. Color:
    can be used to represent the red ... it can also be used rgb (0,0,0) or rgb hex #ddd .... . to display
  3. background image:
    1. write path can put images into a background image (remember added width, height, taller than if the image width,
      will be added in the form of filling; empathy below)

            .c2{
                background-image:url("timg.gif");
                height: 330px;
                width: 440px;
            }

    2. However, if added inside the style background-repeat: no-repeat; width and height does not match then there will not be filled
    3. Add background-position pattern in which: 50px, 60px; can change the image position, moving the second layer, a first layer unchanged, dug out hole does not change the position
    4 can background- and all together
      , such as: background: red url ( 'image.jpg ') 50px -50px no-repeat; default the width and height of div
  4. border:
    border: 4px (the height of the border line) solid (broken line solid line) Red (color), then set the height to the height of the whole frame, may be border-left: only to the left style box plus
  5. display:
    1.display: none; content and location such that the entire label disappears
    2.display: block; inline tags enable block-level tags shown as
    3.display: inline; so that block-level tag shown as inline tags
    4.display: inline-block; tag having such properties inline pure inline and block-level tag, height and width can be set
    5.visibility: hidden; tag so that the content disappears, the position retention
  6.cursor:
    change style on the mouse over the tag
  7. margins:
    paddin g-top: 20px, padding, own label (itself increases)
    margin-top: 20px, margins, not his own label (itself does not increase)
  8. Floating: a float: left ...
    1. this way, two lines or

<div style="width: 500px;background-color: #00b0e8">
    <div style="width: 20%;background-color: red">1</div>
    <div style="width: 80%;background-color: black;color: white">2</div>
</div>

    2 this way does not, each sub-stage left floating as far as possible, go out to the edge if moved up and down, if more than one line will not work together, but this way is equivalent to removing the parent layer

<div style="width: 500px;background-color: #00b0e8">
    <div style="width: 20%;background-color: red;float: left">1</div>
    <div style="width: 80%;background-color: black;color: white;float: left">2</div>
</div>

    3. Such sub-layer does not cover the child when the parent layer, the layer will still display the parent

<div style="width: 500px;background-color: #00b0e8">
    <div style="width: 20%;background-color: red;float: left">1</div>
    <div style="width: 70%;background-color: black;color: white;float: left">2</div>
    <div style="clear: both"></div>  <!--放在最后-->
</div>

 

Guess you like

Origin www.cnblogs.com/otome/p/12560526.html