Web Design Primer 12
Web Design Primer 12
1. What is a URL?
2. Naming Conventions
4. Code Guide
5. Images Guide
Value
https://www.bootstrapcreative.com/design/?filter=a&meta=b#top
contact-us 1 static 19
index.php 2 fonts 20
dist 3 img 21
css 4 pdf 22
main.min.css 5 .gitignore 23
js 6 .htaccess 24
main.min.js 7 Gruntfile.js 25
partials 8 README.md 26
aside.php 9 bower.json 27
src 10 humans.txt 28
scss 11 index.php 29
main.scss 12 package.json 30
_component1.scss 13 robots.txt 31
_component2.scss 14
js 15
vendor 16
plugin.js 17
main.js 18
Curly Braces
display: inline-block;
padding: .5rem 1rem; Declaration Block
border-radius: .25rem;
border: 1px solid;
}
<!DOCTYPE html>
<html lang="en"> 1
<head>
<meta charset="utf-8"> 2
<meta http-equiv="X-UA-Compatible" content="IE=edge"> 3
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-
fit=no"> 4
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="">
<title>Bootstrap Tutorial</title>
<!--
####################################################
C S S - bootstrap, custom styles
####################################################
-->
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-
alpha.6/css/bootstrap.min.css">
<!-- Custom styles for this template -->
<link rel="stylesheet" href="css/main.css">
</head>
<body>
5 <div class="container">
<h1>Page Header</h1>
<div class="row"> 6
<div class="col-md-8" id="main-content" data-background="image.jpg"> 7
<p>Page description paragraph</p>
</div>
/* Sub-component */
If you are creating a new component that is .component-heading {
display: block;
not part of Bootstrap, you can write it in the width: 100px;
format shown in the example to the right. Start font-size: 1rem;
}
with your base styles that all variations have in
common so you are not redundant with styles. /* variant - alert color */
.component-alert {
color: #ff0000;
Next, write your sub component styles and }
variation styles. Any media queries styles
/* variant - success color */
should be added underneath each component .component-success {
and not in a separate stylesheet. This will color: #00ff00;
}
greatly improve future maintenance because
you will know what styles are impacted when a
@media (min-width: 480px) {
component changes. .component-heading { width:auto; }
}
1. Lossless and lossy compression are terms that describe whether or not, in the compression
of a file, all original data can be recovered when the file is uncompressed.
2. 1-bit transparency. Pixels are either solid or completely transparent, but never partially
see-through.
Picture Element
The picture element gives you a lot of control on how your image looks on different breakpoints and
retina displays. As you resize your window the browser will load the necessary image. It takes more
work up-front to build the images but the control is worth it in prominent locations like carousels.
CodePen of various image proportions. If you need to support IE11 and below use this polyfill.
When to Use
• When you want to change how an image looks on different breakpoints (size, cropping, etc.)
• Carousels and Image cards
Web Design Primer Images Guide 1.2 - BootstrapCreative : 26
Responsive Images continued
<img src="https://dummyimage.com/400x200/000/fff" srcset="https://dummyimage.
com/800x400/000/fff 1000w, https://dummyimage.com/1600x600/000/fff 2000w, https://
dummyimage.com/1600x600/000/fff 2x" alt="">
Image srcset
Image srcset is an attribute added to an image tag and provides various images for the browser
to use depending on the viewport width. It is best used when you need little control on how it is
cropped and sized. But you want to speed up page load on mobile and get rid of image pixilation on
retina displays. If you need to support IE11 and below use this polyfill.
One challenge with this solution is that the image is loaded on page load and does not change
when the browser is resized due to image caching. To work around this, I found using the Chrome
extension Cache Killer helps when testing sites.
When to Use
• Blog post images
• Any image you want to look the same (same proportions and image) but just want to
increase resolution.
5. Feelings of failure are normal. What has helped me is allowing more time
No matter how much I learn I will always necessary to learn. Often I would force
have times when I experience feelings of myself to solve something by the end of
inferiority. Sometimes I get assigned a new the day or before lunch. Sometimes it just
project and I cannot figure it out. Everything I takes more time to solve the problem we are
try doesn't work and I have exhausted every facing. Taking a break and do something not
Google search I could think of. The longer computer related helps to clear our mind. So
the problem goes without being solved many times I have struggled with some code
the worse I feel. Then I start asking myself for an entire day and being so stubborn to
questions like, "How can you be a developer stop until it was fixed. Then when I finally did
if you can't solve this?" or "Your boss is take a break, I would come back and find the
going to think you are a fraud and will fire smallest thing causing the problem. Like a
you for not knowing how to solve this." period instead of a comma. : /
Sound familiar?