I have made a textarea but I want tomake a header writing "HTML" in the top right corner in small letters like css-tricks.
My code:
<code><pre><textarea rows="16" cols="60" readonly style="resize:none; font-size: 18px;border:8px ridge #ff0000;">
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Button Ripple Effect | #Programmer</title>
</head>
<body>
<div class="wrapper">
<div class="btns">
<a href="#">Button 1</a>
<a href="#">Button 2</a>
</div>
</div>
</body>
</html>
</textarea></pre></code>
CodePudding user response:
I assume that You want to achieve a similar effect like in this snippet:
header {
display: grid;
justify-items: end;
}
<!doctype html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Button Ripple Effect | #Programmer</title>
</head>
<body>
<header>
<span class="logo">HTML</span>
</header>
<div class="wrapper">
<div class="btns">
<a href="#">Button 1</a>
<a href="#">Button 2</a>
</div>
</div>
</body>
</html>
For future posts please add more info on what did you tried to achieve your goal and maybe add a sketch picture created eg. in Paint or handmade.
CodePudding user response:
Just need a bit of CSS. You may want to use a class selector instead, though.
pre {
position: relative;
display: inline-block;
}
pre::before {
position: absolute;
top: 10px;
right: 10px;
content: "HTML"
}
<pre><textarea rows="16" cols="60" readonly style="resize:none; font-size: 18px;border:8px ridge #ff0000;">
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Button Ripple Effect | #Programmer</title>
</head>
<body>
<div class="wrapper">
<div class="btns">
<a href="#">Button 1</a>
<a href="#">Button 2</a>
</div>
</div>
</body>
</html>
</textarea></pre>