1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-23 09:27:35 +00:00
serenity/Base/res/html/misc/inline-node.html
Sam Atkins fe7e797483 LibWeb: Implement the CSS outline property :^)
...along with `outline-color`, `outline-style`, and `outline-width`.

This re-uses the existing border-painting code, which seems to work well
enough!

This replaces the previous code for drawing focus-outlines, with generic
outline painting for any elements that want it. Focus outlines are now
instead supported by this code in Default.css:

```css
:focus-visible {
    outline: auto;
}
```
2023-08-03 05:25:48 +02:00

63 lines
2.1 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Inline Node styling test</title>
<style>
body {
line-height: 200%;
}
.box {
width: 150px;
height: 200px;
margin: 10px;
padding: 5px;
border: 1px solid black;
}
.highlight {
background-color: orange;
border-radius: 6px;
}
.bg-highlight {
background-image: url("tile.png");
color: white;
border-radius: 6px;
}
.br-highlight {
border: 2px solid green;
border-radius: 6px;
box-shadow: 4px 4px 4px darkgreen;
}
.outline {
outline: 3px dotted magenta;
}
.outline2 {
outline: 1px solid red;
border-radius: 10px;
}
.outline3 {
outline: 2px solid green;
border-radius: 10px;
border: 2px solid black;
}
</style>
</head>
<body>
Hello world <span class="highlight">this is some text</span> not in a box. <span class="bg-highlight">This text has a background</span> and <span class="br-highlight">this text has a shadow!</span>
<div class="box" style="background-color: rgba(255, 0, 255, 0.5);">
Hello world <span class="highlight">this is some text</span> in a box. <span class="bg-highlight">This text has a background</span> and <span class="br-highlight">this text has a shadow!</span>
</div>
<div class="box second">
Hello world <span class="highlight">this is some text</span> in a box. <span class="bg-highlight">This text has a background</span> and <span class="br-highlight">this text has a shadow!</span>
</div>
<div style="background-color:red;width:3px">This text should only have a strip of red on the left</div>
<div class="box">
<span class="outline">This text has an outline</span> and <span class="outline2">this text has an outline with a border radius,</span> and <span class="outline3">this also has a border.</span>
</div>
</body>
</html>