I'm looking to enhance my website by adding a call support button with a responsive design feature. The goal is to display the button exclusively in mobile view and replace it with text in other views.
Encountering challenges in toggling the visibility of the button for a responsive website.
This is what I have tried:
Contact page:
<div>
<p class ="Call-Customer-Support">Contact customer support at 555-555-5555. </p>
<div class="Rectangle">
<img class="call icon-image" src="images/call.png" />
<a class="Call-Support" href="tel:555-555-5555">Call Support</a>
</div>
</div>
In the style.css file:
.Call-Customer-Support {
width: 709px;
height: 18px;
font-family: BentonSans-Bold;
font-size: 16px;
font-style: normal;
font-stretch: normal;
color: #ffffff;
margin: 50px auto;
}
.Rectangle {
width: 292px;
height: 57px;
border-radius: 8px;
background-color: #0e74af;
margin: 50px auto;
}
.call {
width: 24px;
height: 24px;
object-fit: contain;
margin-left:72px;
margin-top:16px;
vertical-align:middle;
float: left;
}
.Call-Support {
width: 116px;
height: 23px;
font-family: BentonSans-Regular;
font-size: 20px;
font-style: normal;
font-stretch: normal;
color: #ffffff;
margin-left: 8px;
vertical-align:middle;
text-decoration: none;
float:left;
display:block;
margin-top:17px;
}
Responsive styling in responsive.css:
@media only screen and (max-width: 767px) {
.Rectangle {
...styles...
}
.call {
...styles...
}
.Call-Support {
...styles...
}
}
@media only screen and (max-width: 479px) {
.Rectangle {
...styles...
}
.call {
...styles...
}
.Call-Support {
...styles...
}
}
Default properties for other sizes:
.Rectangle {visibility:hidden}
.call {visibility:hidden}
.Call-Support{visibility:hidden}
Despite setting these styles, experiencing issues with the visibility of the items...