I've incorporated a theme in my designs where there is a blue bar beneath the text, like shown in the images below
https://i.sstatic.net/TuVGd.png
https://i.sstatic.net/CCJRo.png
Currently, I've been structuring my HTML for these bars in the following way:
<div class="Header">
<h4>My Website</h4>
<div class="YBlock2"></div>
</div>
The CSS class for this structure is defined as:
.YBlock2{
background-color:blue;
width: 50px;
height: 10px;
}
However, I'm questioning whether this is the most effective method. While it looks great on my computer, I'm unsure if it's the best practice for ensuring the site's compatibility with various screen sizes and devices, or for overall optimization.