Table of Contents
Reply to the discussion (solution)
Home Web Front-end HTML Tutorial Anyone who knows css can help me look at this picture, thank you!_html/css_WEB-ITnose

Anyone who knows css can help me look at this picture, thank you!_html/css_WEB-ITnose

Jun 24, 2016 pm 12:12 PM


I made a button and placed it on the navigation menu. The button is transparent, but there is an error in the red circle in the picture!

1. This problem occurs in all browsers I use, including IE, MATHON, and Firefox
2. The buttons made with PS have two formats: png format and gif format. This problem will occur in everyone
3. It is implemented with sliding doors, but I have a basic knowledge of css. I don’t think I made a mistake in css knowledge

Is this a bug or what caused it? Is there any solution, thank you!


Reply to the discussion (solution)

Is that about the picture? The corners haven’t been removed, right?

Let’s see if it’s a problem with your picture?

This should be a picture problem

The background of the picture has not been removed. I am sure about this

For large rounded corners, you should use two pictures on the left and right. You can use one picture. When this happens

Is it because of the picture? The corners have not been removed, right?

It’s not the problem with the picture. The picture is just a well-made rounded corner, and there is no red circle error

The picture is not cut well

Picture The background has not been removed. I am sure of this

The background has been removed, leaving only the transparent part


There is no problem with the picture


The problem is as shown in the picture!

Adaptive button, post the style

There is no problem with the picture
Hey, I told you to use two pictures instead of one. The width of the picture on the left should be smaller.
This happens because you used the image background twice. The right border is opaque because the outer background is transparent, while the inner background is transparent.

If you use an image, you cannot control the width of the outer background image.

ok

Good flight strip CSS:

#menu{
background:url(../images/menu.jpg) no-repeat 0 0;
width:1000px;
height:40px;
text-align:center;
padding-left:15px;
}
#menu li{
float:left;
margin:0 50px;
}
#menu li a{
display:block;
text-decoration:none;
color:white;
vertical-align: middle;
line-height:40px;
}
#menu li a:hover{
background:url(../images/menu_hover.gif) no-repeat top left;
vertical-align:middle;
padding:0 0 0 10px;
margin:-10px;
color:#333;
margin-top:5px;
}
#menu li a:hover strong{
display:block;
background:url(../images/menu_hover.gif) no-repeat top right;
line-height:30px;
vertical-align :middle;
padding:0 10px 0 0;
margin-top:5px;
}

ie6 does not support png transparent background

It is not ie6, but it appears These problems occur in multiple browsers

#menu li a:hover{background:url(../images/menu_hover.gif) left 0; color:#fff; text-decoration: none; line-height:30px; height:30px; float:left}

#menu li a:hover strong{background:url(../images/menu_hover.gif) right 0; padding-right: 10px; margin-left:10px; float:left; height:30px}

The method is like this, the rest is to adjust it yourself

#menu li a:hover{background:url(../ images/menu_hover.gif) left 0; color:#fff; text-decoration:none; line-height:30px; height:30px; float:left}

#menu li a:hover strong{background: url(../images/men……

There is no effect, it should not be a css problem

You can see the effect directly like this

a{background:url(. ./images/menu_hover.gif) left 0; color:#fff; text-decoration:none; line-height:30px; height:30px; float:left}

a strong{background:url(. ./images/menu_hover.gif) right 0; padding-right:10px; margin-left:10px; float:left; height:30px}

Test

You can see the effect directly like this

a{background:url(../images/menu_hover.gif) left 0; color:#fff; text -decoration:none; line-height:30px; height:30px; float:left}

a strong{background:url(../images/menu_hover.gif) rig……

I changed it as you did, but it didn’t work. It’s not a css problem

Is there a picture before and the picture has not been changed to a new one?
You can check if this is true in the folder

Obviously the length of the picture is different

Obviously the length of the picture is different

It’s still the original picture, and It’s not a new question. Is this problem a bug?

I just did some research and found that the background image of the adaptive rounded corner button must have a background color to take effect. The left corner can have no background color but There must be

on the right. How about clearing the history? I feel like the individual pictures you posted below are much wider than the actual renderings?

How about clearing the history? I feel like the individual pictures you posted below are much wider than the actual renderings?
It doesn’t work, hey!

Forget it, guys, help me solve this problem and I will give you points


How to change the value of global variables in javascript?

Pop up Yes, three. I want to increase the value of k that pops up by 1 every time I click the button, but why can’t the value of the global variable always be changed?

Haha, it’s not a css problem, it’s a picture. If you zoom in, you can see it. Just cut it out with ps. The problem I once encountered,

How to use javascript Change global variable value?


Dear friends, can you help solve this problem, thank you!

How to change the value of global variables in javascript?


My experimental results are normal

Unless there is a page postback, if the page is posted back, then set k to the background, and js calls the background method to process and get the value of k

1. Clear browser cache files.
2. Check whether the background color is set for the image, or the background color is set for the element below the image.
3. It is best to use pictures in Gif format.

Still not working, hey...

Still not working, hey...

That’s the problem with your picture, use PS to process it again.

I was looking for the problem of background misalignment of adaptive width when button is clicked on Google, and I accidentally saw this post...

You add a padding-right to li: (width of corner) 6px ;

Then add a padding-left to a: the same width value as above, and that’s it.


If you do this, the background image must be wide enough.

Generally, our approach is to split the picture into two lines, and the background of li is just a corner part.

The background of a is a corner horizontal part.

Sorry, I read it wrong. There is nothing wrong with your code, it’s a problem with the picture.
The lower layer displays the button completely and ends directly with the button on the right.
In the upper layer, the background is on the right and the corners are transparent, so the image below is revealed.
It is recommended to make the picture into two rows, the first row only has the left corner, the second row has no left corner, and the right side continues until the corner appears.

For the lower layer, position the background image left top, and position the strong background above right bottom.

Statement of this Website
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

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)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

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 &lt;datalist&gt; element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

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.

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 &lt;iframe&gt; tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.

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 &lt;progress&gt; element, its purpose, styling, and differences from the &lt;meter&gt; element. The main focus is on using &lt;progress&gt; for task completion and &lt;meter&gt; for stati

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 &lt;meter&gt; element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates &lt;meter&gt; from &lt;progress&gt; and ex

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.

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 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 &lt;time&gt; 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

See all articles