Design comparison
Solution retrospective
I did mostly follow the design here but ran into two issues I could not solve. Firstly, no matter how much I tried to tweak the width, I could not get the "sign in" text at the top to go onto a single line. Second is the logo in the footer which did not want to become white regardless of what property I tried to use (fill, color and a few others were all tried but none worked).
If you want to have a look and see if you can fix this then be my guest.
Community feedback
- @JeuriMorelPosted about 1 year ago
To prevent the Sign In text from wrapping, you can give your
li
swidth: max-content;
. If you want to learn more about how this works you can read the docs here.As for the
img
color, I don't think you can change the fill of ansvg
that is brought in as an img, you'd have to add thesvg
to the HTML. If there were only one thing in the image I would tell you to use a filter, for example:filter: invert(1);
But that inverts the color for everything in it, including the logo.1@ShaunPourPosted about 1 year ago@JeuriMorel Thanks. Appreciate the assist. Also, and this is a rather minor thing, really, there's a tiny bit of side scrolling over to the part to the right of the page content that's just white space. I'd like to do away with that if possible. Do you have any suggestions for this (note: this is just on the 1440px viewport)?
0@JeuriMorelPosted about 1 year ago@DarkPhoenixNinja92 You're welcome. By the way, if you don't want to copy the logo svg directly into the HTML, you can make a copy of the logo svg file, call it something like logo-white.svg, and change the two non-white
fill
properties to white (there's a third that says none, not sure what that one is for.)Another thing, instead of using
<div class="header">
or<div class="footer">
, use<header>
,<footer>
, etc.div
s have no semantic value; they're used when nothing better fits the job.The extra space you're talking about is caused by the
form
's size which is overflowing its parent. One way to fix this is to give its parent (thediv
with a class of "early")overflow: hidden;
.You're still going to get a small scrollbar because of the margin on the body and because you have a number of items with a
width: 100vw;
. I recommend not doing that and instead giving them a width of100%
. (You'll then have to give the<div>
with a class of "main" a width of 100% too.) Normally people start their CSS files with a small reset that makes styling easier and more consistent, which includes removing the default margins and paddings from most or all elements:*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
If you decide to add that reset now you will then have to go and tweak things, so you might be better off just giving your
body
a margin of 0. (People start their CSS files with resets and then work their styles on top of it, not the other way around.)Marked as helpful0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord