I'm just new in front-end development, hope you like my solution to this challenge. I spend about almost 2 hours in total in creating solution for this challenge. Feedback on my solution, i.e, areas for improvements, code optimization, and others are welcome.
You can use the icons from font-awesome. All you have to do is include the font-awesome cdn to access the icons and then you can customise them however you like.
The only thing I would suggest is that you should really read the report that is generated, as it helps a lot in improving the code.
In your code, you have used the paragraph tag everywhere instead you should have used appropriate tags for headings, for instance, there should always be a level one heading that is h1 and they should be used in order such as h1, h2, so on and not randomly.
You need to remove the background from your html code and place it in the styling of the body.
body
{
background-image: url("./images/pattern-background-desktop.svg");
}
To center the card vertically use min-height: 100vh in the body instead of plain height as min-height allows responsive behaviour and adjusts according to the screen sizes.
Always add an alt attribute to the images for better accessibility.
You need to include the following code in the body.
body {
background-image: url("../images/pattern-background-desktop.svg");
background-repeat: no-repeat;
background-size: contain;
}
Since your css file is in a folder, you have to set the image path with ../ that states that the image is located in the folder one level up from the current folder.
Using background-size: contain; makes the entire image fit to the background space.
I rarely use image as my background, is making the page heavy and need more time to load. but this challenge force me to do it. seems i did a wrong code, i already look to other person work but it doesn't work on me. can someone help me to find where is the problem?
I also accept any critic or suggestion to improve my code in the future
You were using background instead of background-image property. Also, you have to be careful in setting the path of the image. In your case your css file is in a folder so that is why you have to set the path with ../ as this states that the image is located in the folder one level up from the current folder.
Using background-size: contain; ensures that the entire background image will fit the background area.
To center the card you need to include the following code once again in the body.
We use min-height instead of plain height because it enables responsive behavior and it will adjust according to the screen size.
Also remove the media query since it is not needed in this case, instead add max-width to the container class as it also enables responsiveness and adjusts the size accordingly.
I'm done with the challenge so far and I don't know how to display the favicon. I got lots of difficulties on GitHub lol because this is my first time using it.
If there are things you see that need tweaking, please let me know.
If the codes are understandable and clean? is the media query rule I used correct?
please give me your reviews on my code if you have time.
What I noticed in the CSS for the container is that you have used both width and max-width. Since max-width overrides width so its better to use just max-width.
The was easier because I completed the Product Card project before this. I used w3schools for reference as well my previous project. It was done a lot faster than the first one. I would love to improve this so suggestions are welcome.
Also in this link: <link href="style.css" text="text/css" rel="stylesheet" /> you need to add type instead of text, because the type of the document is text/css.
My second project. Hope to get some feedback:)
I had some trouble with positioning the bg-pattern-bottom.svg and bg-pattern-top.svg. When I resize my browser the two svg's are not resizing(shrinking) . How can I code this so that they size when I resize the browser?
Another question, on my image I have:
img{ max-width: 100%; }
When I use width: 100% the image gets bigger.
Which one is the best option? and why.
It is good practice to apply background on the body instead of the html tag.
body{ background-image: url(./images/bg-pattern-top.svg), url(./images/bg-pattern-bottom.svg); background-position: right 48vw bottom 30vh, left 45vw top 48vh; background-repeat: no-repeat, no-repeat; }
When we use max-width:100% it means that the width of that particular element will be between 0-100% and not more than that.
So when we use max-width it adjusts the size of the image according to the screen size, as compared to width, which will always keep the images in their original size.
I do have only one challenge with this one. The svg background picture shows all well on Live server with me but disappears, once I check on GitHub pages. There must be something wrong with the path but I tried everything:( Any suggestions? Do I need to encode something here?
Hello,
this is my attempt for this challenge. but I'm having trouble implementing the background in this challenge. what is the best way to implement it? Thank you
Every html page should have some important landmarks so that it is easier for a screen reader to understand the structure of your page.
Such landmarks are header, nav, main, footer, etc.
In your code you need to add a main tag and a footer tag.
Also, it is good practice to start with a level one heading <h1> in your page and then <h2>, <h3> and so on.
Hey! I'm relatively new to these projects and would love any feedback! Can be literally anything- like if you would do anything differently please tell me. Thank you in advance! :)
But you need to add a lang attribute to your html tag.
Also the image tag should always have an alt attribute.
Just make sure to add these in your code and the issues will be resolved.