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
What is the purpose of the <progress> element?What is the purpose of the <progress> element?Mar 21, 2025 pm 12:34 PM

The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

What is the purpose of the <datalist> element?What is the purpose of the <datalist> element?Mar 21, 2025 pm 12:33 PM

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

What is the purpose of the <meter> element?What is the purpose of the <meter> element?Mar 21, 2025 pm 12:35 PM

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

What is the viewport meta tag? Why is it important for responsive design?What is the viewport meta tag? Why is it important for responsive design?Mar 20, 2025 pm 05:56 PM

The article discusses the viewport meta tag, essential for responsive web design on mobile devices. It explains how proper use ensures optimal content scaling and user interaction, while misuse can lead to design and accessibility issues.

How do I use HTML5 form validation attributes to validate user input?How do I use HTML5 form validation attributes to validate user input?Mar 17, 2025 pm 12:27 PM

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

How do I use the HTML5 <time> element to represent dates and times semantically?How do I use the HTML5 <time> element to represent dates and times semantically?Mar 12, 2025 pm 04:05 PM

This article explains the HTML5 <time> element for semantic date/time representation. It emphasizes the importance of the datetime attribute for machine readability (ISO 8601 format) alongside human-readable text, boosting accessibilit

What is the purpose of the <iframe> tag? What are the security considerations when using it?What is the purpose of the <iframe> tag? What are the security considerations when using it?Mar 20, 2025 pm 06:05 PM

The article discusses the <iframe> tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.

What are the best practices for cross-browser compatibility in HTML5?What are the best practices for cross-browser compatibility in HTML5?Mar 17, 2025 pm 12:20 PM

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor