How to modify the title style of html tag with css? (code example)

青灯夜游
Release: 2021-02-19 10:00:15
forward
7420 people have browsed it

How to modify the title style of html tag with css? (code example)

[Recommended tutorial: CSS video tutorial]

Pure CSS to implement tooltip, css changes the title style of the html tag [The author will update when he has time Some boundary conditions. The current style is problematic in extreme cases. Please do not copy the code directly to the online environment. This is just a small demo written by the author]

html code:

The following code is available directly, and the style of tootip can be debugged by yourself.

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .box {
            display: flex;
            justify-content: center;
            align-items: center;
        }
        span {
            position: relative;
            margin: 50px auto;
            border: 1px solid;
        }
        span[aria-label]:hover:after {
            content: attr(aria-label);
            position: absolute;
            bottom: -30px;
            left: 0;
            border: 1px solid;
            width: 100%;
        }
    </style>
</head>
<body>
    <div class="box">
        <span aria-label="我是tooltip">我是主体内容啊</span>
    </div>
</body>
</html>
Copy after login

For more programming-related knowledge, please visit: Programming Teaching! !

The above is the detailed content of How to modify the title style of html tag with css? (code example). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
source:csdn.net
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template