css placering

, css hjælper dig med at holdning din html element.du kan sætte en html element på det sted, som du kan lide.kan de angive, om de vil have elementet anbragt i forhold til sin naturlige plads i side eller absolut baseret på dets moderselskab element. nu vil vi se css placering i forbindelse med egenskaber med eksempler −, relative positionering, relative positionering ændrer holdning til html element i forhold til, hvor det normalt er.So "left:20" adds 20 pixels to the element's LEFT position.,You can use two values ,top, and ,left, along with the ,position, property to move an HTML element anywhere in the HTML document., ,Move Left - Use a negative value for ,left,.,Move Right - Use a positive value for ,left,.,Move Up - Use a negative value for ,top,.,Move Down - Use a positive value for ,top,., ,,NOTE, − You can use ,bottom, or ,right, values as well in the same way as ,top, and ,left,.,Here is the example −, <html> <head> </head> <body> <div style=",position:relative;left:80px;top:2px;,background-color:yellow;"> This div has relative positioning. </div> </body> </html> , ,It will produce the following result −, ,Absolute Positioning,An element with ,position: absolute, is positioned at the specified coordinates relative to your screen top-left corner.,You can use two values ,top, and ,left, along with the ,position, property to move an HTML element anywhere in the HTML document., ,Move Left - Use a negative value for ,left,.,Move Right - Use a positive value for ,left,.,Move Up - Use a negative value for ,top,.,Move Down - Use a positive value for ,top,., ,,NOTE, − You can use ,bottom, or ,right, values as well in the same way as top and left.,Here is an example −, <html> <head> </head> <body> <div style = ", position: absolut; tilbage: 80px; top: farve: gul baggrund 20px;,;" > denne div er absolut placering.< /div > < /organ > < /html >,, fast placering, fast placering, kan du ordne den holdning, at et element, en særlig plads på side, uanset nedad.Specified coordinates will be relative to the browser window.,You can use two values ,top, and ,left, along with the ,position, property to move an HTML element anywhere in the HTML document., ,Move Left - Use a negative value for ,left,.,Move Right - Use a positive value for ,left,.,Move Up - Use a negative value for ,top,.,Move Down - Use a positive value for ,top,., ,,NOTE, − You can use ,bottom, or ,right, values as well in the same way as ,top, and ,left,.,Here is an example −, <html> <head> </head> <body> <div style=",position:fixed; left:80px; top:20px; ,background-color:yellow;"> This div has fixed positioning. < /div > < /organ > < /html >,,



Previous:
Next Page: