In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "how to set up div suspension with css". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to set up div suspension with css".
In css, you can use the position attribute to set absolute positioning to achieve div suspension by adding a style of "{position:absolute;top: distance from the top of the page; left: distance from the left side of the page;}" to the div element.
The operating environment of this tutorial: windows7 system, CSS3&&HTML5 version, Dell G3 computer.
The method of setting div suspension by css
1. Create a new html file, named test.html, to explain how to levitate div in CSS. Within the test.html file, create a div using the div tag and set its class property to con, which is mainly used for the following styling through the class name.
2. In the test.html file, use the p tag in div to create a display of test text. Within the test.html file, within the div, use the div tag to create a div named ff, which is used as the hovering div.
3, in the test.html file, in the css tag, use "*" to initialize the element style, and set the outer and inner margins to 0. At the same time, set the style of the div named con, set its background color to gray, center-aligned, width to 640px, height to 1000px.
In the css tag, and then set the style of the class named ff, set its height and width to 100px, the background color is red, and use the position positioning property to set the absolute position of div in the page, distance from the top of the page to 20px, distance from the left side of the page to 0px, so as to achieve div suspension in the page.
4. Open the test.html file in the browser to see the effect of the implementation.
Position can be set not only to position, but also to fixed to achieve div suspension.
Thank you for reading, the above is the content of "how to set up div suspension with css". After the study of this article, I believe you have a deeper understanding of how to set up div suspension with css, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.