A course by Udacity.
- More than 60% of Bytes per page is # Bootstrap
container-fluidrowcol-xs-*col-sm-*col-md-*col-lg-*container
🎵 The Bootstrap grid system has four classes:
- xs (for phones - screens < 768px wide)
- sm (for tablets - screens => 768px wide)
- md (for small laptops - screens => 992px wide)
- lg (for laptops and desktops - screens=> 1200px wide)
well
img-responsive
text-centertext-dangerh1toh6text-muteddisplay-1todisplay-4leadblockquoteblockquote-reverseblockquote-footer
btnbtn-blockbtn-primarybtn-infobtn-dangerbtn-default
form-control`images.
- Fixed image size in for example pixels would create Unresposive image that will not resize.
- If you make
width : 100%;It will resize as broswer resize but it will lead to pixelation of the image when it resizes to larger of its natural width. - But if you make
max-width: 100%It will resize to a maximum width of its natural width only and will not pixelate. - If you want 2 images to fit side by side you can change to
max-width: 50%;.
- Using
Calcis very important when we want the size (width for example) to take the remaining area after a fixed area is taken (for a maring for example).
This is a quiz.
-
vh: viewport height vw: viewport width. vmin: viewport minimum vmax: viewport maximum.
-
You can set the height of an image to 100% but this only works if the html and body elements are set to 100%.
-
**Alternatively, you can set **
width: 100vw;
height: 100vh;
**
-
Take care of the aspect ratio in this case if you want to keep it.
-
It is better to view vmin and vmax with examples to understand.
-
is a grid of individual dots of color.
-
Source:
- Camera.
- Scanner.
- HTML canvas.
-
Example: photographs.
-
is a set of curves, lines, shapes, fill colors, and gradients.
-
Source:
- Adobe Illustrator.
- Inkscape.
- Using a vector format such as SVG.
-
Examples: Logos, Line art.
-
Browser can render vector images at any size.
- Use JPEG for Photographs.
- Use WebP for Photographs(better than JPEG) (supported by chrome).
- Use SVG for vector images, solid color graphics, logos, line art.
- Use PNG for the same as above if you can't use SVG.
IMPORTANT ❗ Page Speed Insights
-
The latency affects Page loading times more than bandwidth.
-
So to increase performance you need to compress images and decrease the no of requests.
-
It is better to use text overlaying an image than to use a text as an image.
- background-size: cover or contain
- Background images are responsive.
- You can write symbols instead of images by using unicode.
- They are more than 110000 characters.
- They are responsive.
-
They are treated as text.
-
Scalable (responsive) as it is a vector without a decrease in quality with minimum downloads (less requests). Indeed only one request
-
You can style it easily using CSS like shadow, size, color, etc. And you also add it by CSS clases.
-
They are lots of them.
-
**Examples:
-
Maximum scalability.
-
Very low size.
-
Can be implemented using HTML, OR CSS.
-
Some advices for using alt attribute with img element:
altattributes should be set on every image.altattributes should be descriptive for important images.altattributes should be empty for images that are just decorations.\
-
ChromeVox is a free screen reader.