- This topic has 4 replies, 2 voices, and was last updated 2 years, 3 months ago by David.
-
AuthorPosts
-
December 31, 2021 at 9:54 pm #2065369Mary Pearson
I am just starting a website at https://sharpeadvantage.ca/ I have created a 3 section element for above top bar.
I would like the maximum width of this element to be 1200 px, but I would also like to put a top border that extends 100% of the width.
Can you tell me please how to accomplish this.
Many thanks!
January 1, 2022 at 6:47 am #2065541DavidStaffCustomer SupportHi there,
you would need to add a little more HTML and add an inner div for your containment.
<div class="above-top-bar-section"> <div class="inner-abover-top-bar-section"> <!-- your there column sections here --> </div> </div>
If you then move this CSS:
.above-top-bar-section { display: flex; flex-wrap: wrap; max-width: 1200px; margin: 0 auto; }
to:
.inner-abover-top-bar-section { display: flex; flex-wrap: wrap; max-width: 1200px; margin: 0 auto; }
Your
above-top-bar-section
will be full width and you can add a border to it.January 1, 2022 at 11:34 am #2065871Mary PearsonThank you David. I know this should work but for some reason it is not. All three columns are in the middle with the schedule appointment under the other two.
This is what I have
<div class="above-top-bar-section"> <div class="inner-above-top-bar-section"> <div class="above-top-bar-section-1"> <a href="https://sharpeadvantage.ca/free-service-call-with-repair/" title="free service call" rel="home"> <img class="free-service-call-image" src="https://sharpeadvantage.ca/darryl-content/uploads/free-service-call.png" alt="Free Service Call With Repair" title="Free Service Call With Repair"></a> </div> <div class="above-top-bar-section-2"> <a href="https://sharpeadvantage.ca/emergency-service/" title="Sharpe Advantage Heating & Air Conditioning" rel="home"> <img class="above-top-bar-image" src=" https://sharpeadvantage.ca/darryl-content/uploads/24-7.png" alt="Sharpe Advantage Heating & Air Conditioning" title="Sharpe Advantage Heating & Air Conditioning"> </a> </div> <div class="above-top-bar-section-3"> <a href="https://sharpeadvantage.ca/contact-us" title="Sharpe Advantage Heating & Air Conditioning" rel="home"> <img class="top-bar-image" src="https://sharpeadvantage.ca/darryl-content/uploads/schedule-appt.png" alt="Sharpe Advantage Heating & Air Conditioning" title="Sharpe Advantage Heating & Air Conditioning"> </a> </div> </div> </div>
And for CSS I tried replacing
.above-top-bar-section { display: flex; flex-wrap: wrap; max-width: 1200px; margin: 0 auto; }
with
.inner-above-top-bar-section { display: flex; flex-wrap: wrap; max-width: 1200px; margin: 0 auto; }
but that didn’t work so I wasn’t sure what you meant by “move this” so I tried adding it, but that didn’t work either.
Sorry.
January 1, 2022 at 2:51 pm #2065952Mary PearsonFigured it out David. I also had to change `.above-top-bar-section > div {
width: calc(100% / 3); }to
.inner-above-top-bar-section > div {
width: calc(100% / 3); }`Looking good now.
Many, many thanks!!!!January 2, 2022 at 6:23 am #2066291DavidStaffCustomer SupportAwesome – glad to hear you got it working!!
-
AuthorPosts
- You must be logged in to reply to this topic.