š Scenario: You are starting a new website project using Bootstrap. To keep your project organized, you need to create the basic folder structure that holds your HTML files, CSS files, JavaScript files, and Bootstrap files.
šÆ Goal: Create a simple Bootstrap folder structure with folders named css, js, and bootstrap inside a main project folder called my-bootstrap-site.
š What You'll Learn
Create a main folder named my-bootstrap-site
Inside my-bootstrap-site, create three folders named css, js, and bootstrap
Inside the css folder, create an empty file named style.css
Inside the js folder, create an empty file named script.js
Inside the bootstrap folder, create two empty files named bootstrap.min.css and bootstrap.bundle.min.js
š” Why This Matters
š Real World
Organizing files in a web project is like keeping your desk tidy so you can find your tools easily when building a website.
š¼ Career
Web developers must organize their projects well to work efficiently and collaborate with others.
Progress0 / 4 steps
1
Create the main project folder
Create a main folder named my-bootstrap-site to hold all your website files.
Bootsrap
Hint
Think of this as creating a big box to keep all your website stuff inside.
2
Add subfolders for CSS, JS, and Bootstrap
Inside the my-bootstrap-site folder, create three folders named css, js, and bootstrap.
Bootsrap
Hint
These folders will keep your styles, scripts, and Bootstrap files organized.
3
Add empty CSS and JS files
Inside the css folder, create an empty file named style.css. Inside the js folder, create an empty file named script.js.
Bootsrap
Hint
These files will hold your custom styles and JavaScript code.
4
Add Bootstrap CSS and JS files
Inside the bootstrap folder, create two empty files named bootstrap.min.css and bootstrap.bundle.min.js.
Bootsrap
Hint
These files are the Bootstrap framework files you will use in your project.
Practice
(1/5)
1. What is the main purpose of organizing files into folders in a Bootstrap project?
easy
A. To make the website load slower
B. To hide files from the browser
C. To keep CSS, JavaScript, and images separate for easy management
D. To make the project folder look bigger
Solution
Step 1: Understand folder organization
Organizing files into folders helps keep CSS, JavaScript, and images separate and easy to find.
Step 2: Recognize benefits
This separation makes managing and updating the website easier and helps it load properly.
Final Answer:
To keep CSS, JavaScript, and images separate for easy management -> Option C
Quick Check:
Folder organization = Easy management [OK]
Hint: Folders separate file types for clarity and ease [OK]
Common Mistakes:
Thinking folders slow down the website
Believing folders hide files from browsers
Assuming folder size affects project size
2. Which folder name is commonly used to store Bootstrap CSS files in a project?
easy
A. fonts
B. js
C. img
D. css
Solution
Step 1: Identify folder purpose
The css folder is used to store stylesheets including Bootstrap CSS files.
Step 2: Match folder names
js is for JavaScript, img for images, and fonts for font files.
Final Answer:
css -> Option D
Quick Check:
Bootstrap CSS files go in css folder [OK]
Hint: CSS files go in the css folder [OK]
Common Mistakes:
Putting CSS files in js folder
Using img folder for stylesheets
Confusing fonts folder with CSS
3. Given this folder structure: project/ āāā css/ ā āāā bootstrap.min.css āāā js/ ā āāā bootstrap.bundle.min.js āāā img/ āāā logo.png Which file path should you use in your HTML to link the Bootstrap JavaScript file?
medium
A. js/bootstrap.bundle.min.js
B. img/logo.png
C. css/bootstrap.min.css
D. bootstrap.bundle.min.js
Solution
Step 1: Locate JavaScript file
The Bootstrap JavaScript file is inside the js folder named bootstrap.bundle.min.js.
Step 2: Choose correct relative path
To link it in HTML, use js/bootstrap.bundle.min.js as the path.
Final Answer:
js/bootstrap.bundle.min.js -> Option A
Quick Check:
JS file path = js/bootstrap.bundle.min.js [OK]
Hint: JS files are in js folder, use js/filename.js [OK]
Common Mistakes:
Using css folder path for JS file
Using image folder path for JS file
Omitting folder name in path
4. You included Bootstrap CSS in your HTML as <link href='css/bootstrap.min.css'> but styles are not applied. What is the likely folder structure mistake?
medium
A. The CSS file is missing the .css extension
B. The CSS file is in the root folder, not inside css
C. The CSS file is inside the img folder, not css
D. The CSS file is inside the js folder, not css
Solution
Step 1: Check file path in link tag
The link uses css/bootstrap.min.css, so the CSS file must be inside the css folder.
Step 2: Identify mismatch
If the CSS file is actually in the root folder, the path is wrong and styles won't load.
Final Answer:
The CSS file is in the root folder, not inside css -> Option B
Quick Check:
File location must match path in HTML [OK]
Hint: Match file location with path in HTML link [OK]
Common Mistakes:
Putting CSS in js folder
Forgetting .css extension
Putting CSS in img folder
5. You want to add custom styles to your Bootstrap project without changing the original Bootstrap files. Which folder structure is best practice?
hard
A. Create a new css/custom.css file and link it after Bootstrap CSS
B. Put custom CSS inside the img folder
C. Add custom styles inside the js folder
D. Put custom CSS inside the existing css/bootstrap.min.css file
Solution
Step 1: Avoid modifying Bootstrap files
Modifying bootstrap.min.css directly can cause problems when updating Bootstrap.
Step 2: Use separate custom CSS file
Creating css/custom.css and linking it after Bootstrap CSS allows safe customizations.
Final Answer:
Create a new css/custom.css file and link it after Bootstrap CSS -> Option A
Quick Check:
Custom styles in separate CSS file after Bootstrap [OK]