UPDATE (After discussing further):
In order to center the text and ensure the hover effect covers the entire button area without altering its width, make the following adjustments to the CSS:
Existing:
#menu-main li:last-child a {
padding: 7px 19px 5px 15px;
box-sizing: border-box;
padding-border: 42px;
}
#menu-main li:last-child {
box-shadow: inset 0px 0px 0px 0px #none;
box-shadow: inset 0px 0px 0px 0px #none;
box-shadow: inset 0px 0px 0px 0px #none;
background-color: none;
border-radius: 8px;
border-radius: 8px;
border-radius: 66px;
border: 1px solid #ffffff;
display: flex;
color: #ffffff;
padding: 0px 20px;
text-align: center justify-content:center;
align-items: center;
height: 40px;
line-height: 0px;
width: 200px;
box-sizing: border-box;
}
Revised version (Remove padding from button and text, apply border radius to text, match text width and height with button, and eliminate redundant/incorrect bits):
UPDATED:(Include width: 100%
for navbar and use media query for float: right
on button for screens sized 768px
and above):
#menu-main {
width: 100%;
}
#menu-main li:last-child a {
padding: 0px;
line-height: 40px;
border-radius: 66px;
height: 100%;
width: 100%;
}
#menu-main li:last-child {
border-radius: 66px;
border: 1px solid #ffffff;
text-align: center;
height: 40px;
width: 175px;
margin-left: 20px;
margin-top: 5px;
margin-bottom: 5px;
}
@media only screen and (min-width: 768px) {
#menu-main li:last-child {
float: right;
}
}
Happy to assist!
I assume you wish to adjust the padding value in this section?:
#menu-main li:last-child{
box-shadow:inset 0px 0px 0px 0px #none;
box-shadow:inset 0px 0px 0px 0px #none;
box-shadow:inset 0px 0px 0px 0px #none;
background-color: none;
border-radius:1px;
border-radius:1px;
border-radius: 66px;
border: 1px solid #ffffff;
display:inline-block;
color:#ffffff;
//padding:1px 22px;
padding:1px 10px;
}
You may need to experiment with the second pixel value until achieving your desired result, but 10px could be suitable.. padding:1px 10px;
When defining padding
, the first value pertains to top/bottom, while the second represents left/right. Adjusting the latter will influence the amount of padding around the text.
Hoping this clarifies things, feel free to reach out for any further clarifications!