Example analysis of how to make button buttons change color using css
First, let’s take a look at the final rendering:
This is our best goal. If you are interested, fine, then keep reading.
First of all, this button uses the new style attributes of css3.0. If your browser does not see the corner arc style, it means that your browser version does not support the new style of CSS3.0. The solution is to upgrade your browser to the latest one. As far as I know, XP and Windows Server 2003 support up to IE8 (you can see the effect). If you don’t want to upgrade IE, you have to download a browser that is not IE-based, such as Firefox, Google, Opera, etc.
Okay with all the nonsense ahead, let’s take a look at how to make our beautiful buttons.
In fact, we use the CSS pseudo-element here, hover.
First we must put an input type button on the page. Add css style to this button button.
The specific css code is as follows:
.mybtn { width:86px; text-align:center; line-height:100%; padding-top:0.5em; padding-right:2em; padding-bottom:0.55em; padding-left:2em; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-variant:normal; font-weight:normal; text-decoration:none; margin-top:0px; margin-right:2px; margin-bottom:0px; margin-left:2px; vertical-align:text-bottom; display:inline-block; cursor:pointer; zoom:1; outline-width:medium; outline-color:invert; font-size-adjust:none; font-stretch:normal; border-top-left-radius:0.5em; border-top-right-radius:0.5em; border-bottom-left-radius:0.5em; border-bottom-right-radius:0.5em; box-shadow:0px 1px 2px rgba(0,0,0,0.2); text-shadow:0px 1px 1px rgba(0,0,0,0.3); color:#fefee9; border-top-color:#da7c0c; border-right-color:#da7c0c; border-bottom-color:#da7c0c; border-left-color:#da7c0c; border-top-width:1px; border-right-width:1px; border-bottom-width:1px; border-left-width:1px; border-top-style:solid; border-right-style:solid; border-bottom-style:solid; border-left-style:solid; background-image:none; background-attachment:scroll; background-repeat:repeat; background-position-x:0%; background-position-y:0%; background-size:auto; background-origin:padding-box; background-clip:padding-box; background-color:#f78d1d; }
For specific css style explanation, please go to Baidu, which can improve your css level. If you don't know CSS skills but want to use this effect, what you need to modify is the width of the button and set it to the appropriate width of your button. Another thing is to replace the background color.
After writing the css style and the input button button, we should associate them. We only need to add the class to the input button.
<input type="button" class="mybtn" value="我是按钮" />
Now we have the last step, which is to use the pseudo-element hover of css,
to write a mybtn hover style. The code is as follows:
.mybtn:hover { background: #f47c20; }
Because we only need to modify the background color when we move the mouse up, we only need to modify one attribute in the hover style.
The above is the detailed content of Example analysis of how to make button buttons change color using css. For more information, please follow other related articles on the PHP Chinese website!

I got this question the other day. My first thought is: weird question! Specificity is about selectors, and at-rules are not selectors, so... irrelevant?

Yes, you can, and it doesn't really matter in what order. A CSS preprocessor is not required. It works in regular CSS.

You should for sure be setting far-out cache headers on your assets like CSS and JavaScript (and images and fonts and whatever else). That tells the browser

Many developers write about how to maintain a CSS codebase, yet not a lot of them write about how they measure the quality of that codebase. Sure, we have

Have you ever had a form that needed to accept a short, arbitrary bit of text? Like a name or whatever. That's exactly what is for. There are lots of

I'm so excited to be heading to Zürich, Switzerland for Front Conference (Love that name and URL!). I've never been to Switzerland before, so I'm excited

One of my favorite developments in software development has been the advent of serverless. As a developer who has a tendency to get bogged down in the details

In this post, we’ll be using an ecommerce store demo I built and deployed to Netlify to show how we can make dynamic routes for incoming data. It’s a fairly


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

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.

WebStorm Mac version
Useful JavaScript development tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Atom editor mac version download
The most popular open source editor