Skip to main content

Posts

Add View Section to Blog

  Add View Section to Blog Send Feedback Let's add a view section ( using a div tag ) to our blog, which represents the number of visits to our blog. Although it would be static for now, we can change it to dynamic later. So, we will use some text formatting tags to add the views section. The instructions are provided below. Note: The text formatting tags are always inline. Instructions to follow - 1. Add a separate view section (using a div tag ) inside the article in the container (div tag )of the first image of the article. 2. Now, add 2 span's with content as: 'Views:' and '1,137'. Make these span's bold using the appropriate text formatting tag. Expected Blog page is - <!DOCTYPE html> <html>     <head>         <title>Best Coding Practices</title>     </head>     <body>         <div>             <header>       ...

Sonnet 6

  Sonnet 6 Send Feedback Go through the following code and create an internal link at the top of the page “Go to Sonnet 6” and link it to Sonnet 6 <h2> tag. Hint: Add id attribute to the <h2> tag for Sonnet 6 for linking. code for this <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Document</title> </head> <body> <h1>Shakespeare's Sonnets!</h1> <!-- Internal Link to Sonnet 6 --> <a href="#sonnet6">Go to Sonnet 6</a> <h2 id="sonnet1">Sonnet 1: From Fairest Creatures We Desire Increase</h2> <p> From fairest creatures we desire increase, That thereby beauty’s rose might never die, But as the riper should by time decrease, His tender heir mught bear his memeory:...

Add Semantic Tag to Blog

  Add Semantic Tag to Blog Send Feedback Now, knowing the importance of DIV and Semantic tags, we will apply it to our blog page as well. So, divide your page into several sections eg., header, main, etc., whichever apply in your case. Remember, we use DIV to divide the page into meaningful sections and sometimes to apply some properties. So, there's nothing wrong and right while dividing your page, just don't add unnecessarily. Some hints are provided below. Note: Always apply one  <div>  just after  <body>  tag and then put everything inside it, i.e. header, main and footer. Hints to add semantic tags - 1. Make header section for the web page. 2. Make the main section for the blog. 3. Make header section for the blog. 4. Make article section for the blog. The blog page look the same as in the image below - <!DOCTYPE html> <html>     <head>         <title>Best Coding Practices</title> ...

Print Like a Wave

  Print Like a Wave Send Feedback For a given two-dimensional integer array/list of size (N x M), print the array/list in a sine wave order, i.e, print the first column top to bottom, next column bottom to top and so on. Input format : The first line contains an Integer 't' which denotes the number of test cases or queries to be run. Then the test cases follow. First line of each test case or query contains two integer values, 'N' and 'M', separated by a single space. They represent the 'rows' and 'columns' respectively, for the two-dimensional array/list. Second line onwards, the next 'N' lines or rows represent the ith row values. Each of the ith row constitutes 'M' column values separated by a single space. Output format : For each test case, print the elements of the two-dimensional array/list in the sine wave order in a single line, separated by a single space. Output for every test case will be printed in a seperate line...

Query And Matrix

  Query And Matrix Send Feedback You are given a binary matrix with ‘M’ rows and ‘N’ columns initially consisting of all 0s. 'Q' queries follow. The queries can be of 4 types: Query 1: 1 R index Query 2: 1 C index Query 3: 2 R index Query 4: 2 C index In each query, the first input is the type of the query, the second input is whether we have to consider the row ('R') or the column ('C') and the third input is the index of the row/column. For each type 1 query, we need to flip the elements of the row/column having the given index. For each type 2 query, we have to output the number of zeros present in the row/column having the given index. Note: Note that the matrix is a binary matrix, meaning that it only contains either 0 or 1. Example : Given M = 3, N = 3, Queries : 1R1, 1R2, 2C1 So, in the above example the change in the matrix would look like this: Next query 2C1 will return the count of the number of zeroes in the 1st column: 1 Input Format: The f...