Quite realistic, css3 is really powerful. What points should be paid attention to are still the same. The difficulty lies in fine-tuning the details, especially the production of gradient background. CSS3 is very flexible. Next time I have the opportunity, I will post a detailed tutorial on CSS3 gradient background.
Quite realistic, css3 is really powerful.
Friendly reminder: Please do not browse under IE.
Let’s take a look at the original author’s design sketch:
Concise creation process
Step one: Create the following menu structure
<p id="startmenu"> <ul id="programs"> <li><a href="#"><img src="/static/imghwm/default1.png" data-src="firefox-32.png" class="lazy" alt="" />Mozilla Firefoxa></li> <li><a href="#"><img src="/static/imghwm/default1.png" data-src="chrome.png" class="lazy" alt="" />Google Chromea></li> <li><a href="#"><img src="/static/imghwm/default1.png" data-src="safari.png" class="lazy" alt="" />Safaria></li> <li><a href="#"><img src="/static/imghwm/default1.png" data-src="opera.png" class="lazy" alt="" />Operaa></li> <li><a href="#"><img src="/static/imghwm/default1.png" data-src="ie.png" class="lazy" alt="" />Internet Explorera></li> <li><a href="#"><img src="/static/imghwm/default1.png" data-src="rss_32.png" class="lazy" alt="" />RSS Feedsa></li> <li><a href="#"><img src="/static/imghwm/default1.png" data-src="twitter_32.png" class="lazy" alt="" />Twittera></li> <li><a href="#"><img src="/static/imghwm/default1.png" data-src="delicious_32.png" class="lazy" alt="" />Deliciousa></li> <ul> <ul id="links"> <li class="icon"><img src="/static/imghwm/default1.png" data-src="folder.png" class="lazy" alt="" /></li> <li><a href="#"><span>Documentsspan>a></li> <li><a href="#"><span>Picturesspan>a></li> <li><a href="#"><span>Musicspan>a></li> <li><a href="#"><span>Computerspan>a></li> <li><a href="#"><span>Networkspan>a></li> <li><a href="#"><span>Connect tospan>a></li> <ul> p>
The start menu of win7 has two parts, the program menu on the left and the system menu on the right.
Step 2: Menu container css
#startmenu { border:solid 1px #102a3e; overflow:visible; display:inline-block; margin:60px 0 0 20px; -moz-border-radius:5px;-webkit-border-radius:5px; position:relative; box-shadow: inset 0 0 1px #fff; -moz-box-shadow: inset 0 0 1px #fff; -webkit-box-shadow: inset 0 0 1px #fff; background-color:#619bb9; background: -moz-linear-gradient(top, rgba(50, 123, 165, 0.75), rgba(46, 75, 90, 0.75) 50%, rgba(92, 176, 220, 0.75)); background: -webkit-gradient(linear, center top, center bottom, from(#327aa4),color-stop(45%, #2e4b5a), to(#5cb0dc)); }
There are several points of concern, you can pay attention to:
-moz-border-radius:5px;-webkit-border-radius:5px;圆角效果,这是css3中应用最广的 box-shadow: inset 0 0 1px #fff; -moz-box-shadow: inset 0 0 1px #fff; -webkit-box-shadow: inset 0 0 1px #fff;阴影效果 background: -moz-linear-gradient(top, rgba(50, 123, 165, 0.75), rgba(46, 75, 90, 0.75) 50%, rgba(92, 176, 220, 0.75));渐变背景
Step 3: css on the left side of the menu
#programs { background:#fff; border:solid 1px #365167; margin:7px 0 7px 7px; box-shadow: 0 0 1px #fff; -moz-box-shadow: 0 0 1px #fff; -webkit-box-shadow: 0 0 1px #fff; -moz-border-radius:3px;-webkit-border-radius:3px;} #programs a { border:solid 1px transparent; display:block; padding:3px; margin:3px; color:#4b4b4b; text-decoration:none; min-width:220px;} #programs a:hover {border:solid 1px #7da2ce; -moz-border-radius:3px; -webkit-border-radius:3px; box-shadow: inset 0 0 1px #fff; -moz-box-shadow: inset 0 0 1px #fff; -webkit-box-shadow: inset 0 0 1px #fff; background-color:#cfe3fd; background: -moz-linear-gradient(top, #dcebfd, #c2dcfd); background: -webkit-gradient(linear, center top, center bottom, from(#dcebfd), to(#c2dcfd));} #programs a img {border:0; vertical-align:middle; margin:0 5px 0 0;}
What is worth noting here is the effect setting of the mouse passing through the menu item, which is the style in #programs a:hover, This is the difficulty, and it is also the power of CSS3, which is still rounded corners, shadows, and gradient backgrounds.
Step 4: The CSS part on the right side of the menu
#links {margin:7px; margin-top:-30px;} #links li.icon {text-align:center;} #links a {border:solid 1px transparent; display:block; margin:5px 0; position:relative; color:#fff; text-decoration:none; min-width:120px;} #links a:hover {border:solid 1px #000; -moz-border-radius:3px; -webkit-border-radius:3px; box-shadow: 0 0 1px #fff; -moz-box-shadow: inset 0 0 1px #fff; -webkit-box-shadow: inset 0 0 1px #fff; background-color:#658da0; background: -moz-linear-gradient(center left, rgba(81,115,132,0.55), rgba(121,163,184,0.55) 50%, rgba(81,115,132,0.55)); background: -webkit-gradient(linear, 0% 100%, 100% 100%, from(#517384), color-stop(50%, #79a3b8), to(#517384)); } #links a span { padding:5px; display:block; } #links a:hover span { background: -moz-linear-gradient(center top, transparent, transparent 49%, rgba(2,37,58,0.5) 50%, rgba(63,111,135,0.5)); background: -webkit-gradient(linear, center top, center bottom, from(transparent), color-stop(49%, transparent), color-stop(50%, rgba(2,37,58,0.5)), to(rgba(63,111,135,0.5))); }
What are the points to pay attention to? The difficulty lies in fine-tuning the details, especially The production of gradient background is very flexible in CSS3.
The above is the entire content of this article. I hope it will be helpful to everyone's study. For more related content, please pay attention to the PHP Chinese website!
Related recommendations:
How to use CSS to implement a large drop-down menu
CSS page layout with left, middle and right columns Implementation
The above is the detailed content of Use css3 to imitate the start menu of window7. For more information, please follow other related articles on the PHP Chinese website!

CSS Grid is a powerful tool for creating complex, responsive web layouts. It simplifies design, improves accessibility, and offers more control than older methods.

Article discusses CSS Flexbox, a layout method for efficient alignment and distribution of space in responsive designs. It explains Flexbox usage, compares it with CSS Grid, and details browser support.

The article discusses techniques for creating responsive websites using CSS, including viewport meta tags, flexible grids, fluid media, media queries, and relative units. It also covers using CSS Grid and Flexbox together and recommends CSS framework

The article discusses the CSS box-sizing property, which controls how element dimensions are calculated. It explains values like content-box, border-box, and padding-box, and their impact on layout design and form alignment.

Article discusses creating animations using CSS, key properties, and combining with JavaScript. Main issue is browser compatibility.

Article discusses using CSS for 3D transformations, key properties, browser compatibility, and performance considerations for web projects.(Character count: 159)

The article discusses using CSS gradients (linear, radial, repeating) to enhance website visuals, adding depth, focus, and modern aesthetics.

Article discusses pseudo-elements in CSS, their use in enhancing HTML styling, and differences from pseudo-classes. Provides practical examples.


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

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

Hot Article

Hot Tools

Dreamweaver CS6
Visual web development tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

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

SublimeText3 Mac version
God-level code editing software (SublimeText3)

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.
