search
HomeWeb Front-endHTML TutorialThe page img has a gap problem_html/css_WEB-ITnose

    


    The page img has a gap problem_html/css_WEB-ITnose
    The page img has a gap problem_html/css_WEB-ITnose
    The page img has a gap problem_html/css_WEB-ITnose
    The page img has a gap problem_html/css_WEB-ITnose
    The page img has a gap problem_html/css_WEB-ITnose
    The page img has a gap problem_html/css_WEB-ITnose
    The page img has a gap problem_html/css_WEB-ITnose
    The page img has a gap problem_html/css_WEB-ITnose
    The page img has a gap problem_html/css_WEB-ITnose
    The page img has a gap problem_html/css_WEB-ITnose
    The page img has a gap problem_html/css_WEB-ITnose
    The page img has a gap problem_html/css_WEB-ITnose
    The page img has a gap problem_html/css_WEB-ITnose
    The page img has a gap problem_html/css_WEB-ITnose
    The page img has a gap problem_html/css_WEB-ITnose
    


These img automatically vacated the grid for me. I didn’t set its padding and margin, but it seems that they already exist. How to eliminate them?
Setting its padding and margin to 0 and border to 0 has no effect. How to remove its original spaces??

#main_div_log02{width:960px;height:186px;margin-top:5px;}
#main_div_log02 img{padding:0;margin:0;border:0;}

Reply to the discussion (solution)

Is it a problem with the picture? Give the picture brother a try with width and height

Use firebug to see if other settings are inherited. It should be the priority. Question

You add the sentence float:left; in #main_div_log02 img{padding:0;margin:0;border:0;} and change it to #main_div_log02 img{padding:0;margin:0;border :0;float:left;}, in this case the gap between the pictures will be gone!

If you don’t want to float, you can write img on one line, just don’t press enter.

There should be no carriage return space between The page img has a gap problem_html/css_WEB-ITnose

There should be no carriage return space between The page img has a gap problem_html/css_WEB-ITnose
Dizzy! Carriage return and line feed in code are useless!

If you don’t want to float, you can write img on one line, just don’t press enter.
Have you tried it? Don't talk nonsense. What's the difference between putting it on one line and putting it on several lines? it's useless!

The page img has a gap problem_html/css_WEB-ITnoseIt is useful to write all the characters on one line without adding a carriage return.

There is something wrong with LZ’s attitude. I must have a certain reason for saying this.

I remember that I encountered a similar problem before, and then I just wrote it in one line.

LZ, you are here to ask others to help you solve your problem. How do you know it doesn’t work if you haven’t tried it? You just take it for granted that it doesn’t work.

Then why are you asking? ? ? ?

If you have tried it and the method I said does not work for your problem, you can say it, but not in this tone!

LZ, let’s go back and learn how to behave!

Quoting the reply from danica7773 on the 4th floor:
If you don’t want to float, you can write the img in one line, just don’t press enter.

Have you tried it? Don't talk nonsense. What's the difference between putting it on one line and putting it on several lines? it's useless!
Even if someone else’s reply is wrong, don’t use this tone of voice

Add border to the img style and take a look
Generally, img{padding:0;margin:0;border: is added at the beginning of the style sheet. 0;}, and then set it up separately when you need to add these.

Khan. . . On the #9th floor. It wasn’t me who replied. . . I have no problem with my attitude.
Solved it myself. Thank you anyway.
is placed inside ul li and the width and height of li must be defined. I referred to the css of Xunlei Kankan

Indeed, this problem still exists. There is almost 3 pixels of space under Firefox, but there is no space under IE7 and 8.
This is because there is a gap when div and img are combined.

To solve this problem, just write this

#main_div_log02{width:960px;height:186px;margin-top:5px;}
#main_div_log02 img{padding:0;margin: 0;border:0; display:block;}

This is indeed the case. I tried it and it solved it! Thank you!
Please add this float:left; to #main_div_log02 img{padding:0;margin:0;border:0;} and change it to #main_div_log02 img{padding:0;margin:0;border:0; float:left;}, in this case the gap between the pictures will be gone!

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
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

What is the 'class' attribute in HTML?What is the 'class' attribute in HTML?Apr 28, 2025 pm 05:37 PM

The article explains the HTML 'class' attribute's role in grouping elements for styling and JavaScript manipulation, contrasting it with the unique 'id' attribute.

What are different types of lists in HTML?What are different types of lists in HTML?Apr 28, 2025 pm 05:36 PM

Article discusses HTML list types: ordered (<ol>), unordered (<ul>), and description (<dl>). Focuses on creating and styling lists to enhance website design.

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

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

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.