.
Search code, repositories, users, issues, pull requests..., provide feedback.
We read every piece of feedback, and take your input very seriously.
Use saved searches to filter your results more quickly.
To see all available qualifiers, see our documentation .
File metadata and controls, lab instructions: create and style a webpage.
In this exercise you will you will practice building your webpage using HTML and CSS.
Tips: Before you Begin To view your code and instructions side-by-side , select the following in your VSCode toolbar: View -> Editor Layout -> Two Columns To view this file in Preview mode, right click on this README.md file and Open Preview Select your code file in the code tree, which will open it up in a new VSCode tab. Drag your assessment code files over to the second column. Great work! You can now see instructions and code at the same time.
Follow the Step by Step instructions below:
Open the index.html file and set up the following basic HTML document structure:
Set the title of the HTML document to your name:
Link to styles.css in the head element.
Add five divider elements to the body element.
Add a heading 1 to the first divider element that displays your name.
Add photo.jpg using an image element in the second divider element..
Add an ID attribute with the value photo on the image element.
Add a heading 2 for Favorite Music Artists in the third divider element. In the same divider add an unordered list with your top 5 favorite artists.
Add a heading 2 for Favorite Films in the fourth divider element. In the same divider add an ordered list with your top 5 favorite films.
Add a hyperlink to your Facebook profile page in the last divider element. Alternatively, add a hyperlink to https://www.meta.com/ . As a last step, add My Profile to the descriptive text of the <a> tag.
Open the styles.css file.
Add a CSS rule for your image that sets the border property to 2 pixels wide with a solid blue color.
Add a CSS rule for heading 1 containing your name and set its color to blue .
Add a CSS rule for all <h2> headings and set their color to grey .
Add a CSS rule that applies a margin of 4 pixels to the divider elements.
Nice work! To complete this assessment:
Your code will be autograded and return feedback shortly on the "Grades" tab. You can also see your score in your Programming Assignment "My Submission" tab.
Learn with fun
In this article i am gone to share Coursera Course: Introduction to Front-End Development Week 2 | Programming Assignment: Create and style a webpage Solution with you..
Enroll Link: Introduction to Front-End Development
Also visit: Programming Assignment: Styling a page Solution
Instructions
Please click on the blue “Work in Browser” button above. When the VSCode User Interface (UI) opens, open the README.md file in Preview mode and follow the instructions. To view the README.md file in Preview mode, right click on the README.md file and choose “Open Preview” as shown below:
To complete this assessment:
To your view the rendered HTML in a Web Page follow the step by step instructions below:
Step 1: Save the file.
Step 2: Click on ‘Go live’ at the bottom right of your editor.
Step 3: Click on browser preview.
Step 4: Enter the url as http://localhost:<exposed port>
Step 5: Check that the web page displays.
After completing your lab, don’t forget to close the server. You can close the server by clicking on the exposed Port number (e.g. 5500) after completing the lab.
Exposed port You should see a notification like this which confirms the server has been stopped. Notification that the server is now offline
HTML File..
Your email address will not be published. Required fields are marked *
Save my name, email, and website in this browser for the next time I comment.
Greetings, Hey i am Niyander, and I hail from India, we strive to impart knowledge and offer assistance to those in need.
Programming assignment 2 – styling your app.
The purpose of this assignment is to introduce you to styling web pages in Grails and includes introductions to:
You are to complete this programming assignment individually. In this assignment you will make “responsive” public views for the book store’s website using Twitter Bootstrap. In particular you will make responsive home page, and list views for books and authors.
If you do not already know HTML and CSS, read the brief tutorial at W3Schools:
http://www.w3schools.com/html/default.asphttp://www.w3schools.com/css/default.asp
You do not have to be an expert in HTML and CSS, but you should know the basics. Read through the tutorial in the above links and get an idea of the language and the material that is in these tutorials. This will take you about 60 minutes. When you need to use the language, you’ll know where to look.
Read the Twitter Bootstrap documentation. In particular scan the the layout, content and the components documentations:
Pay particular attention to the section about the bootstrap grid system:
https://getbootstrap.com/docs/5.2/layout/grid/
This is the heart of the bootstrap’s responsiveness. When you read, realize that the grid system is mobile first. This implies that on small devices the columns in a row will be stacked. When you set the “div class=”, you specify how it will look on larger devices. You will have to experiment with the grid system to fully understand it.
Also study the Navbar component:
https://getbootstrap.com/docs/5.2/components/navbar/
Currently, basic Twitter Bootstrap styling and component files are already incorporated into Grails. Examine the files “grails-app/assets/stylesheets/” and “grails-app/assets/javastripts/bootstrap/”. The JavaScript files are minified and sufficient for the programming assignment.
I like to save the Grails generated views for the administrative backend of the web site because they do not have to look as pretty as the public views and the generated pages look well enough for administrative use. For the public pages, I like to code separately the views and style them using bootstrap.
https://gsp.grails.org/latest/guide/index.html#viewsAndTemplateshttps://gsp.grails.org/latest/guide/index.html#layouts
You should notice that there is already a “main.gsp” layout in the “grail-app/views/layout/” directory. Your public pages will use a different layout, so create a gsp file in the views/layout/. Call it site.gsp.
Copy and paste the code below to your site.gsp
Grails uses Sitemesh to implement layouts:
http://wiki.sitemesh.org/wiki/display/sitemesh3/SiteMesh+3+Overview
You will not have to understand all of Sitemesh’s complexities to create a simple layout. The layout GSP specifies the general layout of the view. In essences, any view rendered with a layout will be a combination of two GSP files, the layout GSP and the specific view GSP files, called the “target page” in the documentation. Both the layout GSP and specific view GSP use special “g:layout…” tags. In the above layout GSP, “site.gsp”, the special “g:layout” tags are
Soon we will make the specific GSP view for the home page and this will make more sense.
There are three other tags in the layout GSP
The navigation bar is complex enough to have it own GSP file. Also having the navigation bar in a separate file will let you swap out and in different navigation bars.
Read about navbar in the bootstrap documentation:
Add the “_navbar.gsp” file to the root of the views directory. Note the leading underscore. You need the underscore in the name of the file so that Grails can identify it as a template view.
Copy and paste the code into your _navbar.gsp template view.
The navbar is described by three major div classes, the “navbar”, “navbar-toggler” and the “navbar-collapse”. The nav-tag, has the class “navbar-expand-md” that describes the break point in which the collapsing menu will disappear and the navbar-toggler-icon will appear. The other classes apply styling to the navbar. The button-tag with the class navbar-toggler contains the navbar-toggler-icon. It is the button for expanding the menu when the screen width is smaller then the break point. It must have “data-target” id that matches the id of “navbar-collapse” The “navbar-collapse” describes a list with the links in the collapsed menu. Notice that the navbar-collapse is linked to the navbar-header through its id, “navbarNav”.
Study the Examples in the bootstrap examples.
https://getbootstrap.com/docs/5.2/examples/
Decide how you want the Book Store home page to look. For example you may want to use a Jumbotron for the home page. Look at the page source for how the Jumbotron is coded. If you lack initiative you can use code below for your home page. Replace the content of grails-app/views/index.gsp with the code below.
Now stop and run the app again. You should see the public home page with the navigation bar. Adjust the browser window width. Notice that when the browser window width is narrow the hamburger menu appears, and when clicked, the menu expands. Also notice that when the browser window is wide then the menu is expanded into the navbar area.
If you visited the controller list view and clicked on the Grails icon at the top left, you will notice that it points the browser to the root of the server context instead of the app home page.
Open the main.gsp file. In the navbar section of main.gsp layout, look at the anchor tag with the class designation “navbar-brand.” The href attributes points to the root of the server.
We should change the URL for the navbar-brand. Also, we probably do not want the Grails icon if the link is to point to our app home page. Replace the entire anchor tag with
Now someone using the admin pages has an easy link back to the public pages.
The public home page probably does not look as good as you might like. You should add some styling.
Add the file “myStyles.css” to the directory grails-app/assets/stylesheet/, and then cut and paste the content below into the myStyles.css:
Now you must source your style sheet to the site.gsp file. There are two ways to source the style sheet into the view. If you want the syles to appear only on the public pages then in the head of the site.gsp file just below the asset:stylesheet tag for application.css add the link to your style sheet so that your styles will over write bootstrap styles:
If you should reverse the order then bootstrap styles will overwrite your styles and your styles will have no effect.
If you’d like your styles to effect all views including the admin pages then you will need to edit the “asset/stylesheets/application.css” file. The asset-pipeline documentation is at:
http://bertramdev.github.io/grails-asset-pipeline/
In particular, you need to read the usage section:
http://bertramdev.github.io/grails-asset-pipeline/guide/usage.html#directives
In short, we need to add to the list of “require” style files to application.css
I added the “*= require myStyles” at the bottom but above “*= require_self”. In this location myStyles will over write any styles in sheets listed above, but any styles defined in application.css will over write the styles in myStyles.
You might need to re-run the application for the styles to appear so that asset-pipeline can source them into the app’s views.
In the views/index.gsp add the center class to the h1 tag:
You do not need to re-run Grails to view the changes. You only need to refresh the page in your browser.
Use the Chrome browser to inspect element styles. Open the Chrome browser, and right click on the page, and select “inspect element.” This will open the Developer’s Tools. The tool allows you examine styling inheritance and temporally add new styles to elements.
Note that you do not have to stop and run the app to view your style changes, but the effects may not show for a while. Generally, the app only needs restarting when you change the domain class or controller.
Currently, I like to make separate controllers for the public pages. This keeps the admin pages completely separate from the public pages.
Naming the public controllers can be tricky because the controller name will appear in the URL. Consequently, we want the name to be short and memorable. In the case of a public page showing a list of books, we might like to call it “Book”, but that name is already being used by the admin controllers. We could call it “Books”, especially since its index view will show a list of books. This is not always the best choice for the name because it differs from the admin controller by a single letter, “s”. Nevertheless, we will name our public controller “Books”, and we’ll have to be careful to discriminate it from the admin controller.
Use the Grails command to make a new controller. Call it “Books”. The editor should show the BooksController.grooy file with an empty index method or action.
We will want the cs4760progassign/books/ page to show the list of books sorted by the title of the book and showing the author of the book. We will develop the code using Test Driven Development (TTD). The TTD process is to first write the unit tests for the component and then write the code to pass the tests.
It is hard to write a test without the code, but I suggest thinking about the data and writing an example on how the data should behave. Assume that the Author domain has objects:
Where I am modeling the Author object as a map, and authorA_ID is a long integer. Also assume that the Book domain has objects:
Again I have modeled the domain objects as maps. The index action of the BooksController should pass to the view a model which has a list of maps that contain the title of the book and the author for the book. We want the list to be ordered by the book title. In other words, the model passed to the view should be:
[bkList: [ [title: “Title A”, author: “Author A”], [title: “Title B”, author: “Author B”], [title: “Title C”, author: “Author C”] ], …]
Where bkList is the key to retrieve the list of ordered title/author maps:
[ [title: “Title A”, author: “Author A”], [title: “Title B”, author: “Author B”], [title: “Title C”, author: “Author C”] ]
Now we can write the unit test. It will use MockDomains so BooksControllerSpec will need to also implement DataTest.
The setupSpec method declares the mock domains for Author and Book. The test uses blocks to setup the test, execute the action, and then test the results. The “given” block setups the tests by adding the data to the mockDomains. The “when” block executes the action by calling the controller index action. Finally the “then” block test the results. Note that “model” in the “then” block is a property of the response object sent to the view. The model is a map that the view can use to populate dynamics properties in the view. For the index BooksController view the model should contain a list of books and authors. Note we need to use the render method in the Controller in order to set the model.
Note that the test is not hard to write if we used the approach of considering the data. Run the test and it will fail. You can run just the unit tests by entering
The output from the test will appear cs4760progassign/build/reports/tests/test/index.html. You can right click the index.html and select “run” to view the report.
Now we can write the code for the index action.
Copy and paste the code below for the Books controller methods.
Now run the test. It passes.
The programming language in the Books controller is groovy. Groovy is a scripting language built on top of Java. You can almost always write Java instead of groovy in a groovy file.
Because the BooksController is in the same package as the domain classes, it has access to the domain classes. The call “Book.listOrderByTitle() gets a list of books in the Book table and sorts them by the title. You can read the about GORM Querying at
https://gorm.grails.org/latest/hibernate/manual/#querying
The “list” call can work very much like dynamic finders
https://gorm.grails.org/latest/hibernate/manual/#finders
The particular documentation for “listOrderBy” can be found in the “Quick Reference” listed on the right of the documentation. Look in “Domain Classes”:
http://docs.grails.org/latest/ref/Domain%20Classes/listOrderBy.html
After getting the list of all the books, the code constructs a sub Map, “bkAuthor” which will contain the title of the book under the key, “title”, and the author of the book under the key, “author”. Finally this sub map is added to the “bkList” List. The action returns a Map with key “bkList” to the List “bkList.”
You can read about groovy at
http://groovy-lang.org/documentation.html
In particular you will want to study the syntax of the language
http://groovy-lang.org/syntax.html
This code uses List and Map syntax built into groovy
http://groovy-lang.org/syntax.html#_lists
http://groovy-lang.org/syntax.html#_maps
Add an “index.gsp” file to the /views/books/ directory.
Cut and paste the code below into the views/books/index.gsp.
The index view makes use of Grails tags, g-tags. Documentation for g-tags are found in the “Quick Reference” at the bottom under “Tags” in the Groovy Server Pages documentation. In particular the “each” tag is at:
https://gsp.grails.org/latest/ref/Tags/each.html
We need a link to the Books index view. This can be in the navbar menu. Open the _navbar.gsp file in the editor. Replace the anchor tag for the Books link:
with a g:link tag in the navbar-collapse section of the navbar:
You should be able to view the new public books controller by clicking on the books link in the navbar. Note that the outputs from println appear in the run console at the bottom of IntelliJ IDEA. Select the “Grails: cs4760progassign” tab. You can modify the code and refresh page in the browser without “stopping and running” the app. As long as no new classes are made the browser will pick up the changes.
You are on your own making the new Authors controller, coding the index method/action and making the new view. Use what you have learned from the steps above.
We want the page to look a little different than the Books view. The Authors public view should be hierarchical list. The top most list should be an alphabetical list of authors and below each author should be an indented alphabetical list of book titles for the author. In other words, we want the view to appear similar to:
Note that the code and model will be more complex than for the BooksController index action. You probably will want to use nested maps in the model. I suggest that you think about the data first and what the model should look like.
Note, that writing the unit tests for AuthorsControllerSpec.groovy is challenging. Consequently you do not have to write and pass unit tests in AuthorsControllerSpec.groovy.
Also do not forget to change the link for the Authors menu item in the navbar.
After creating the public Authors index view, make a screen shoot of the public Authors page. The URL is
Submit the screen shoots in canvas for the “Programming Assignment 2 – Styling your App”.
IMAGES
VIDEO
COMMENTS
Quiz - Examine the page; Module Quiz: Get started with Web Development; Week 2. Quiz - Getting Started with HTML; Quiz - CSS Basics; Module Quiz - Introduction to HTML and CSS; Programming Assignment - Creating a HTML Document; Programming Assignment - Styling a Page; Programming Assignment - Create and Style a Webpage; Week 3. Quiz - Working ...
Select "Submit Assignment" in your Lab toolbar. Your code will be autograded and return feedback shortly on the "Grades" tab. You can also see your score in your Programming Assignment "My Submission" tab.
Select "Submit Assignment" in your Lab toolbar. To your view the rendered HTML in a Web Page follow the step by step instructions below: Step 1: Save the file. Step 2: Click on 'Go live' at the bottom right of your editor. Once the server is up and running you'll see the exposed port. Step 3: Click on browser preview.
Link to styles.css in the head element.. Add five divider elements to the body element.. Add a heading 1 to the first divider element that displays your name. Add photo.jpg using an image element in the second divider element... Add an ID attribute with the value photo on the image element.. Add a heading 2 for Favorite Music Artists in the third divider element.
You are to complete this programming assignment individually. In this assignment you will make new "responsive" public views for the book store's website using Twitter Bootstrap. In particular you will make responsive home page, and list views for books and authors. Step 1: Learn HTML and CSS
There are 4 modules in this course. Web content is accessed by millions across the globe every day. Attractive web pages help businesses grow and provide an omnipresent experience to the viewers. In this course you will get an understanding on how HTML5 is used to structure simple web pages from scratch and how CSS3 enhances their appearance.
You are to complete this programming assignment individually. In this assignment you will make new "responsive" public views for the book store's website using Twitter Bootstrap. In particular you will make responsive home page, and list views for books and authors. Step 1: Learn HTML and CSS
About Press Copyright Contact us Creators Advertise Developers Terms Privacy Policy & Safety How YouTube works Test new features NFL Sunday Ticket Press Copyright ...
Meta Back-end Developer. I am taking the Meta Back-end Developer Professional Certificate program. I am not sure what I am dong wrong with the CSS Project Assignment: Styling A Page. If it says for the CSS , you have #copyright with a padding top of 12px and font-size of 0.75em. Wouldn't the declaration box be:
About Press Copyright Contact us Creators Advertise Developers Terms Privacy Policy & Safety How YouTube works Test new features NFL Sunday Ticket Press Copyright ...
Introduction to front-end development by Meta programming assignment Lab Instructions: Create and style a webpage In this exercise you will you will practice building your webpage using HTML and CSS. Task 1: Create the HTML file. Objectives. Add photo.jpg to the webpage. Add your name as a heading to the webpage.
To control how our content looks, we use CSS (Cascading Style Sheets). First, you have to create a new file in your repository. Create the folder css and in it the file style.css. Edit this file and place the following code inside: color: hotpink; We will explain this in a minute, but first switch to your layout file, default.html.
#viral #trending #courseracertificate #coursera #google My Facebook profile-https://www.facebook.com/isratjahan.tisha.547Subscribe free!!! click here to subs...
xxxxxxxxxx. 1. 1. Console. Assets. Comments. An assignment for the 'Programming and the Web for Beginners' certification MOOC on Coursera....
You are to complete this programming assignment individually. In this assignment you will make new "responsive" public views for the book store's website using Twitter Bootstrap. In particular you will make responsive home page, and list views for books and authors. Step 1: Learn HTML and CSS
The purpose of this assignment is to introduce you to styling web pages in Grails and includes introductions to: HTML and CSS; Groovy; Twitter Bootstrap CSS framework g-tags; You are to complete this programming assignment individually. In this assignment you will make "responsive" public views for the book store's website using Twitter ...
Check out a free preview of the full Getting Started with CSS course. The "Styling Page Sections" Lesson is part of the full, Getting Started with CSS course featured in this preview video. Here's what you'd learn in this lesson: Jen live codes debugging and styling the previously built sections of the webpage to work outside of CodePen.
In doing so, it covers both the modern web development workflow and Javascript programming. Syllabus; Week 1: HTML / SVG ('Drawing') Week 2: CSS ('Styling') Assignment 1; Assignment 1 Submissions; Week 3: JS Fundamentals I ... The <style> element will instruct the browser that anything within it consists of CSS and should be used to style the ...
You can also see your score in your Programming Assignment "My Submission" tab. Tips. If you get stuck, apply the CSS rules one at a time and verify their behaviour is what you expect. Review the lessons Selecting and Styling, Text and color in CSS, Different types of selectors, and Box Model Introducction.
Style the webpage using CSS. Follow the Step by Step instructions below: Open the styles.css file. Add a CSS rule for your image that sets the border property to 2 pixels wide with a solid blue color. Add a CSS rule for heading 1 containing your name and set its color to blue.
Once you have chosen a topic, this assignment has four components: Create a static web page (HTML) Style a web page (CSS) Create a responsive view (CSS) Deploy and test your website; Create a Static Web Page . Design your web page — you are recommended to draw the UI without coding or implementation. Transform your drawing into an HTML file.
Select "Submit Assignment" in your Lab toolbar. To your view the rendered HTML in a Web Page follow the step by step instructions below: Step 1: Save the file. Step 2: Click on 'Go live' at the bottom right of your editor. Once the server is up and running you'll see the exposed port. Step 3: Click on browser preview.
The purpose of this assignment is to introduce you to styling web pages in Grails and includes introductions to: HTML and CSS; Groovy; Twitter Bootstrap CSS framework; g-tags; You are to complete this programming assignment individually. In this assignment you will make "responsive" public views for the book store's website using Twitter ...