search
HomeWeb Front-endHTML TutorialThings about position in css style layout_html/css_WEB-ITnose

Hey, page layout and design development are indeed very time-consuming, laborious, and difficult for someone who has been engaged in backend development.


Tonight I want to overlap multiple pictures together, or mark different locations in a picture and assign hyperlinks. It took me a whole night to get it initially, and I roughly understood the usage of the following css attributes.


【1】Set the tag to float and discuss with your colleagues:

HTML tags have block level and line level (as for those that are block level, According to Baidu), each block level will occupy one line of the html document (the reason why it is one line is that there will be a line break after the block level). If the block-level label is set to float, the label: (1) is separated from the original parent label. (2) Can be displayed on one line.


【2】position is set to fixed.

fixed is relative to the entire browser. Interested students can try it out by setting a sized label to fixed and zooming the browser so that the browser generates scroll bars (up and down or left and right). When the scroll bar is pulled, the label set to fixed will not change. of its location.


【3】position is set to absolute.

absolute is relative to the nearest parent tag. Still the same experiment as above, when the scroll bar is pulled, the label set to absolute will also change with the change of the position of the html document.


【4】position is set to relative.

relative is relative to the original position of the tag.


The following is a test picture I made tonight to see the effect:


(1) line a It is absolute

(2) Line b is fixed.

My main purpose in the above picture is to mark the positions of make1~8 in the disk, and then provide hyperlinks. The specific code is:

<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><!--<link type="text/css" rel="stylesheet" media="all" href="webCss.css">--><title>mydw</title><style>body {	background:#CCCCCC;}a.makeR1{ left:150px; top:45px; width:70px; height:80px;}a.makeR2{ right:150px; top:45px;width:70px; height:80px;}a.makeR3{ left:65px; top:135px; width:70px; height:80px;}a.makeR4{ right:65px; top:135px;width:70px; height:80px;}a.makeR5{ left:65px; top:265px; width:70px; height:80px;}a.makeR6{ right:65px; top:265px;width:70px; height:80px;}a.makeR7{ right:215px; top:365px;width:70px; height:60px;}a.makeR8{ right:180px; top:160px;width:137px; height:137px;}.makeR9{ right:180px; top:160px;width:137px; height:137px;}.roundMakeBox{	position:fixed;	z-index:99992; 		text-align:center;	left:50%; 	margin-left:-250px; 	width:499px;	height:501px;	border:1px solid blue;}.roundLink{ position:relative; bottom:0px;z-index:99993;border:1px solid green;}.roundLink a{ display:block;position:absolute;z-index:99994;border:1px solid red;background:#FFFF00;}#img1{ display:block;position:absolute;z-index:99994;border:1px solid red;}</style><div class="roundMakeBox">	<div class="roundLink">		<img  src="/static/imghwm/default1.png" data-src="makeRound.png" class="lazy" alt="Things about position in css style layout_html/css_WEB-ITnose" >		<a href="#" class="makeR1">makeR1</a>		<a href="#" class="makeR2">makeR2</a>		<a href="#" class="makeR3">makeR3</a>		<a href="#" class="makeR4">makeR4</a>		<a href="#" class="makeR5">makeR5</a>		<a href="#" class="makeR6">makeR6</a>		<a href="#" class="makeR7">makeR7</a>		<a href="#" class="makeR8">makeR8</a>		<img  class="makeR9 lazy" src="/static/imghwm/default1.png" data-src="LOGObg.png" id="img1" alt="Things about position in css style layout_html/css_WEB-ITnose" >	</div>
</div>


In addition

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
The Versatility of HTML: Applications and Use CasesThe Versatility of HTML: Applications and Use CasesApr 30, 2025 am 12:03 AM

HTML is not only the skeleton of web pages, but is more widely used in many fields: 1. In web page development, HTML defines the page structure and combines CSS and JavaScript to achieve rich interfaces. 2. In mobile application development, HTML5 supports offline storage and geolocation functions. 3. In emails and newsletters, HTML improves the format and multimedia effects of emails. 4. In game development, HTML5's Canvas API is used to create 2D and 3D games.

What is the root tag in an HTML document?What is the root tag in an HTML document?Apr 29, 2025 am 12:10 AM

TheroottaginanHTMLdocumentis.Itservesasthetop-levelelementthatencapsulatesallothercontent,ensuringproperdocumentstructureandbrowserparsing.

Are the HTML tags and elements the same thing?Are the HTML tags and elements the same thing?Apr 28, 2025 pm 05:44 PM

The article explains that HTML tags are syntax markers used to define elements, while elements are complete units including tags and content. They work together to structure webpages.Character count: 159

What is the significance of <head> and <body> tag in HTML?What is the significance of <head> and <body> tag in HTML?Apr 28, 2025 pm 05:43 PM

The article discusses the roles of <head> and <body> tags in HTML, their impact on user experience, and SEO implications. Proper structuring enhances website functionality and search engine optimization.

What is the difference between <strong>, <b> tags and <em>, <i> tags?What is the difference between <strong>, <b> tags and <em>, <i> tags?Apr 28, 2025 pm 05:42 PM

The article discusses the differences between HTML tags , , , and , focusing on their semantic vs. presentational uses and their impact on SEO and accessibility.

Please explain how to indicate the character set being used by a document in HTML?Please explain how to indicate the character set being used by a document in HTML?Apr 28, 2025 pm 05:41 PM

Article discusses specifying character encoding in HTML, focusing on UTF-8. Main issue: ensuring correct display of text, preventing garbled characters, and enhancing SEO and accessibility.

What are the various formatting tags in HTML?What are the various formatting tags in HTML?Apr 28, 2025 pm 05:39 PM

The article discusses various HTML formatting tags used for structuring and styling web content, emphasizing their effects on text appearance and the importance of semantic tags for accessibility and SEO.

What is the difference between the 'id' attribute and the 'class' attribute of HTML elements?What is the difference between the 'id' attribute and the 'class' attribute of HTML elements?Apr 28, 2025 pm 05:39 PM

The article discusses the differences between HTML's 'id' and 'class' attributes, focusing on their uniqueness, purpose, CSS syntax, and specificity. It explains how their use impacts webpage styling and functionality, and provides best practices for

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.