text-overflow: clip | ellipsis | string | initial | inherit;
<!DOCTYPE html>
<html>
<head>
<style>
div {
white-space: nowrap;
height: 30px;
width: 250px;
overflow: hidden;
border: 2px solid black;
font-size: 25px;
}
.jtp {
text-overflow: clip;
}
.jtp1 {
text-overflow: ellipsis;
}
h2 {
color: blue;
}
div:hover {
overflow: visible;
}
p {
font-size: 25px;
font-weight: bold;
color: red;
}
</style>
</head>
<center>
<body>
<p> Hover over the bordered text to see the full content. </p>
<h2>
text-overflow: clip;
</h2>
<div class="jtp">
Welcome to the bianchenghao6.com
</div>
<h2>
text-overflow: ellipsis;
</h2>
<div class="jtp1">
Welcome to the bianchenghao6.com
</div>
</center>
</body>
</html>
<html>
<head>
<title>
CSS text-overflow Property
</title>
<style>
div {
width: 250px;
font-size: 20px;
white-space: nowrap;
border: 2px solid red;
overflow: hidden;
text-overflow: ellipsis;
}
h1,
h4 {
color: red;
}
p {
white-space: nowrap;
overflow: hidden;
text-overflow: inherit;
}
div:hover {
overflow: visible;
}
p:hover {
overflow: visible;
}
</style>
</head>
<body>
<h1> Hover over the text to see the full content </h1>
<div>
<h4> text-overflow: ellipsis; </h4>
Welcome to the bianchenghao6.com
<h4> text-overflow: inherit; </h4>
<p>
This paragraph inherited the value from its parent div element.
</p>
</div>
</body>
</html>