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

Video Face Swap

Video Face Swap

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

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)

Is HTML easy to learn for beginners? Is HTML easy to learn for beginners? Apr 07, 2025 am 12:11 AM

HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.

The Roles of HTML, CSS, and JavaScript: Core Responsibilities The Roles of HTML, CSS, and JavaScript: Core Responsibilities Apr 08, 2025 pm 07:05 PM

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

Understanding HTML, CSS, and JavaScript: A Beginner's Guide Understanding HTML, CSS, and JavaScript: A Beginner's Guide Apr 12, 2025 am 12:02 AM

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

Gitee Pages static website deployment failed: How to troubleshoot and resolve single file 404 errors? Gitee Pages static website deployment failed: How to troubleshoot and resolve single file 404 errors? Apr 04, 2025 pm 11:54 PM

GiteePages static website deployment failed: 404 error troubleshooting and resolution when using Gitee...

What is an example of a starting tag in HTML? What is an example of a starting tag in HTML? Apr 06, 2025 am 12:04 AM

AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM.

How to use CSS3 and JavaScript to achieve the effect of scattering and enlarging the surrounding pictures after clicking? How to use CSS3 and JavaScript to achieve the effect of scattering and enlarging the surrounding pictures after clicking? Apr 05, 2025 am 06:15 AM

To achieve the effect of scattering and enlarging the surrounding images after clicking on the image, many web designs need to achieve an interactive effect: click on a certain image to make the surrounding...

HTML, CSS, and JavaScript: Essential Tools for Web Developers HTML, CSS, and JavaScript: Essential Tools for Web Developers Apr 09, 2025 am 12:12 AM

HTML, CSS and JavaScript are the three pillars of web development. 1. HTML defines the web page structure and uses tags such as, etc. 2. CSS controls the web page style, using selectors and attributes such as color, font-size, etc. 3. JavaScript realizes dynamic effects and interaction, through event monitoring and DOM operations.

How to implement adaptive layout of Y-axis position in web annotation? How to implement adaptive layout of Y-axis position in web annotation? Apr 04, 2025 pm 11:30 PM

The Y-axis position adaptive algorithm for web annotation function This article will explore how to implement annotation functions similar to Word documents, especially how to deal with the interval between annotations...

See all articles