After successfully displaying text on the same line using an @media
query, I encountered issues with CSS not working as expected in desktop view without the query. To address this, I applied an @media
query below 768px
, which resolved the mobile display but failed to meet my desired layout for desktop above 768px
.
The goal is to have the text appear side by side with a slight spacing both on mobile and desktop screens.
Despite efforts, my @media
query for desktop remains ineffective. Below are snippets of the CSS and HTML code:
@media (min-width: 768px) and (max-width: 5000px) {
.findanevent {
float: left;
}
}
@media (min-width: 768px) and (max-width: 5000px) {
.event {
float: right;
}
}
HTML Code:
<div class="lasvegas">
Events</div>
<div class="findanevent"> </div>
<div class="event_wrapper"><a
href="https://adsler.co.uk/find-an-
event/"><span id="findanevent"
class="event">Find an Event</span>.
</a>
<a href="https://adsler.co.uk/post-
an-event/"><span id="postanevent"
class="event">Post an Event</span>.
</a></div>
If you want to see the page for reference, follow this link: