Hello everyone,
I am trying to make a responsive notification bar but when I resize the screen list items breaks up and text is going beneath I want it to be inline as screen resize.
Here is my code.
<div class="notification-bar">
<ul class="notification-list">
<li class="list-item list-item1">
<span>Lorem ipsum dolor sit amet.</span>
</li>
<li class="list-item list-item2">
<span>Lorem ipsum dolor sit amet.</span>
</li>
<li class="list-item list-item3">
<span>Lorem ipsum dolor sit amet.</span>
</li>
<li class="list-item list-item4">
<span>Lorem ipsum dolor sit amet.</span>
</li>
<li class="list-item list-item5">
<span>Lorem ipsum dolor sit amet.</span>
</li>
</ul>
</div>
<ul class="notification-list">
<li class="list-item list-item1">
<span>Lorem ipsum dolor sit amet.</span>
</li>
<li class="list-item list-item2">
<span>Lorem ipsum dolor sit amet.</span>
</li>
<li class="list-item list-item3">
<span>Lorem ipsum dolor sit amet.</span>
</li>
<li class="list-item list-item4">
<span>Lorem ipsum dolor sit amet.</span>
</li>
<li class="list-item list-item5">
<span>Lorem ipsum dolor sit amet.</span>
</li>
</ul>
</div>
Personally I think you should be working in em instead of px when doing responsive web design. I would also suggest looking into media queries and design for mobile first.
Well, that’s going to be tough for small screens such as mobile devices. I would suggest having 100 percent width on mobile devices then use media queries for large devices (mobile first responsive design). I would look into flex-wrap also other flex options as well - https://css-tricks.com/snippets/css/a-guide-to-flexbox/
We’re still not clear what you want to happen when things shrink such that the end of one “amet.” touches the start of the next “Lorem”. You don’t want the text to wrap. You don’t want it to go off the edge of the screen, with a scroll bar. You don’t want it to overlap. What do you want to happen at that stage? Are you wanting the text to get smaller? It would very soon become unreadable.
Of course its too small to read at small screen sizes but will be larger at larger screen sizes. Note also that some users will have a set a minimum font-size in their browser controls and that will always over-ride the css.