-
AuthorPosts
-
January 6, 2019 at 11:53 am #1050547
Hi Guys
I need a little help if possible please.
I have used a code block to create some horizontal buttons. The layout is perfect on the large iMac I design on. But as I look at smaller computer screens or tablets/mobiles – the buttons dont seem to auto adjust?
Code for buttons: <ul class=”c-buttons”>
- INFORMATION TECHNOLOGY
- HEALTHCARE
CSS: .c-buttons {
text-align:center;
}
.c-buttons li {
background: rgba(255,255,255,0.2);
list-style-type:none;
display:block;
float:left;
border:1px solid #423e42;
}
.c-buttons li:hover {
background: rgba(255,255,255,0.2);
color:#ffffff;
}
.c-buttons li a {
padding:60px;
color:#423e42;
}Website attached in private content. There are a number of buttons on that page which fall out of line as the screen size reduces.
Thanks!
DeeJanuary 7, 2019 at 6:04 am #1050748January 7, 2019 at 10:13 am #1050813Hi Rikard
I would like to them possibly still stay next to each other on computer / laptop size screens and then they can go one underneath each other on small screens. Whatever layout would look right? Can you see how they look now on a smaller screen?
Regards
DeeJanuary 8, 2019 at 5:08 am #1051175Hi Dee,
You could try to add specific CSS for tablets/phone sized screens:
@media only screen and (min-width: 768px) and (max-width: 1024px) { tablet CSS goes here } @media only screen and (max-width: 767px) { phone CSS goes here }
Best regards,
RikardJanuary 8, 2019 at 11:48 am #1051345Hi Rikard
I have tried this css and nothing has changed:
@media only screen and (max-width: 767px) {
.c-buttons li {
background: rgba(255,255,255,0.2);
list-style-type:none;
display:block;
float:center;
border:1px solid #423e42;
}
.c-buttons li:hover {
background: rgba(255,255,255,0.2);
color:#ffffff;
}
.c-buttons li a {
padding:0px;
color:#423e42;
}Also – its not just on mobile and tablet but as you go down from my large iMac screen to even a slightly smaller screen it throws out the buttons and they do not reduce down like the rest of the site?
Thanks
DeeJanuary 10, 2019 at 7:02 am #1052199 -
AuthorPosts
- You must be logged in to reply to this topic.