text:
# Slick2d Particles loading xml returning null [closed]

I've made a particle class that creates a particle of Slick2d library, but the XML file doesn't want to load , it keeps giving me null error. I gave it the path as I do for everything but it refuses to work and its been like this for days I just cant get it to open that XML file. If anyone can help me it would be much appreciated.

try {
particleImage = new Image("res/particles/particle.png", false);
system = new ParticleSystem(particleImage,1500);

//load the xml file and add the emitter to the system
File xmlFile = new File("res/particles/bloodDown.xml");
ConfigurableEmitter emitter = ParticleIO.loadEmitter(xmlFile);
emitter.setPosition(315, 358);
} catch (Exception e) {
System.out.println("Exception: " +e.getMessage());
e.printStackTrace();
System.exit(0);
}

Entire particle class : http://pastebin.com/rBR0xpE7

Particle manager class : http://pastebin.com/N8gNFk6W

Slick 2d documentation : http://www.slick2d.org/javadoc/

My structure of workspace:

## closed as too localized by bummzack, Anko, MichaelHouse♦, Josh♦, ClassicThunderApr 25 '13 at 15:44

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.

• Have you stepped through your code to identify exactly where the problem is? If the xml file is loading properly, but the returned emitter is null, then chances are there is a formatting issue with the xml file. If the xml file just never loads, then consider investigating a pathing issue. – Evan Apr 21 '13 at 5:17
• Its the path issue, I print out the path it looks fine like for everything else, its just that ConfigurableEmitter emitter = ParticleIO.loadEmitter(xmlFile); doesnt load it. – Matthew Apr 21 '13 at 6:14
• Printed out the path? I assume you know how to use breakpoints for debugging correct? Well, assuming that your File is being constructed properly(that the XML file is actually found), then the xml format may be incorrect. – Evan Apr 21 '13 at 14:39
• Well it does print out the name of the xml file that is stored inside the xml. But there is still ERROR:null java.lang.NullPointerException at javagame.ParticleManager.update(ParticleManager.java:25) , i checked 10 times with debugging and i still dont know what is wrong with it – Matthew Apr 21 '13 at 15:22
• Well what line specifically is it giving you the NRE on? That will give you a hint as to what's wrong. – Tetrad Apr 22 '13 at 3:22


text:
Q9.    A field is in the shape of a trapezium whose parallel sides are 25 m and 10 m. The non-parallel sides are 14 m and 13 m. Find the area of the field.

D Divya Prakash Singh

The trapezium field is shown below in figure:

Drawing line CF parallel to AD and a line perpendicular to AB, we obtain

$CF || AD$                         ............................ $\left [ \because\ by\ construction \right ]$

$CD || AF$                        ............................  $\left [ \because ABCD\ is\ a\ trapezium \right ]$

So, $AD = CF = 13\ m$  and  $CD = AF = 10\ m$

$\left ( \because Opposite\ sides\ of\ a\ parallelogram \right )$

Therefore, $BF = AB-AF = 25-10 = 15\ m$

Now, the sides of the triangle;

$a = 13\ m,\ b =14\ m\ and\ c = 15\ m.$

So, the semi-perimeter of the triangle will be:

$s= \frac{a+b+c}{2} = \frac{13+14+15}{2} = \frac{42}{2} = 21\ m$

Therefore, the area of the triangle can be found by using Heron's Formula:

$Area = \sqrt{s(s-a)(s-b)(s-c)}$

$= \sqrt{21(21-13)(21-14)(21-15)}$

$= \sqrt{21(8)(7)(6)}$

$= \sqrt{7056} = 84\ m^2.$

Also, the area of the triangle is given by,

$Area = \frac{1}{2}\times BF\times CG$

$\Rightarrow \frac{1}{2}\times BF\times CG = 84\ m^2$

$\Rightarrow \frac{1}{2}\times 15\times CG = 84\ m^2$

Or,

$\Rightarrow CG = \frac{84\times2}{15} = 11.2\ m$

Therefore, the area of the trapezium ABCD is:

$= \frac{1}{2} \times (AB+CD)\times CG$

$= \frac{1}{2} \times (25+10)\times 11.2$

$= 35\times5.6$

$= 196\ m^2$

Hence, the area of the trapezium field is $196\ m^2.$

Exams
Articles
Questions

format: plain


text:
## Getting the wrong txid for coinbase transactions

1

1

I'm trying to hash transactions to get the txid. I get the hex values from blockchain.info. I get the correct hash for all transactions except for the coinbase when I hash it twice. Is there something different about how the coinbase transaction is supposed to be hashed?

The block I have tried is: https://blockchain.info/no/block/0000000000000000000870497004514bd3807cdc98b9f3a57038faf5df04144f.

The txid of the coinbase is supposed to be:
44763fed906f1a0e8b82e7497ac83856baa4b1c5621affdce04108a212018c4e

But I get:
6e129e567970540b2812ec58388d131c3b8fdbf4e4c992d140e255895df2992e

## Answers

2

The txid is the hash of transaction without segwit data. The full coinbase transaction contains the segwit data which will result in the hash that you got. However that is not the txid.

Thanks, would you mind telling me what segwit data is? – jørgen k. s. – 2018-04-15T19:17:54.050

1

See BIP 144: https://github.com/bitcoin/bips/blob/master/bip-0144.mediawiki. The hash that you have is the witness ID.

– Andrew Chow – 2018-04-15T19:21:42.723

1

The hash you created is the wtxid (hash of Witness ID), not the txid (hash of Transaction ID):

For the difference between txid and wtxid, see Mastering Bitcoin ch. 7 § "Transaction identifiers".

0

You appear to have a bad copy of the raw transaction.

When I look at the raw transaction for txid in the blockchain (coinbase transaction for block height 486,273, block hash 00000000000000000083cbfd33b63c2ac10e703266c5749bf3ce2fbff88f5791), I get the following:

Code:

01000000 01000000 00000000 00000000

00000000 00000000 00000000 00000000

00000000 00ffffff ff310381 6b07244d

696e6564 20627920 416e7450 6f6f6c6b

2f454231 2f414436 2f4e5941 2f332059

c36d7be1 550000df 320000ff ffffff02

38252e4d 00000000 1976a914 66037132

6d3a2e06 4c278b20 107a65da d847e8a9

88ac0000 00000000 0000266a 24aa21a9

edc11e8c dbd8d442 b27bf8f2 73395baa

83b5da4c 9c3d87fb c539dad7 42480437

10000000 00

When I calculate hashlib.sha256(hashlib.sha256(data).digest()).digest() on that data, I get the correct result.


text:
## johnny101 one year ago -

1. jdoe0001

hmmm $$\bf sin^{-1}(sin(\theta))\implies \theta$$

2. jdoe0001

as far as the range, yes, that's the default range constraints for the inverse sine

3. jdoe0001

but I don't think we can get an absolute angle value from that

4. jdoe0001

$$\bf y = sin(x)\implies sin^{-1}(y)=sin^{-1}(sin(x)\implies sin^{-1}(y)=x$$


text:
## Students Bribed Teachers To Do Their Continuous Assessment (CALA) Modules

Many students at primary and secondary schools are alleged to paid bribes of around US$10 to US$20 to teachers to "assist" them do their "debatable" Continuous Assessment Learning Activities (CALA) modules.

CALA was added to the learning curriculum this year and it contributes to a large 30% of the overall exam marks for Grade Seven, Ordinary and Advanced Level students. It calls for learners to perform, exhibit their knowledge, expertise and proficiency of the subject concerned via academic activities.

Grade 7, Form 4 and Form 6 learners have been pressured to do CALA after an order to schools from Primary and Secondary Education secretary Tumisang Thabela despite that learning was affected by lengthy breaks brought about by COVID-19 lockdowns. Though teachers argued for CALA to be suspended, the govenment turned a deaf ear.

Progressive Teachers Union of Zimbabwe (PTUZ) president Takavafira Zhou yesterday informed Parliament that some work submitted by students for CALA was clearly carried out for them by other people for a fee.

"There has been an emergence of some people overnight claiming that there are specialists ready to do CALA for students," he said.

"So we are seeing the submission of certain CALA projects, not necessarily originating from students because they were hard-pressed.

"Those with access to money ended up buying people (including teachers) to do it for them, and so we would not be assessing the students’ work but an academic mercenary’s work.

"The cost for a primary school project is US$10. Primary pupils are doing three projects per subject area, and with six subject areas, they have to do 18 projects in all. "Secondary pupils’ projects are charged at US$20 per project. Pupils do three projects per subject area and so you can see how lucrative the venture has emerged to be in schools."

Zhou said students needed to be assessed on an identical platform and that the implementation of CALA was rushed which makes it biased due to other students cheating.

"The whole essence of CALA is that we must create an equal platform for assessing our students from an equal position. It shouldn’t be an added advantage to students with access to money. We must look at a student in Chiendambuya or Mberengwa. Can that student produce meaningful CALA projects without rigorous training, monitoring and supervision by the teacher?"

"There are lot of questions that have not been answered and what we see is a rash decision along a wrong direction," Zhou said.

"The speed is also too much. I think we need to put some brakes somehow."

A Form 6 pupil at a high school in Mt Darwin informed NewsDay that some students paid US\$3 to have their CALA tasks carried out for them by other people.

Primary and Secondary Education spokesperson Taungana Ndoro confirmed having received such reports, however said the ministry had handled the issue.

"Yes, there were reported cases of schools where some teachers were charging for CALA. We have since dealt with that issue. The reports were minimal and we have since dealt with them decisively. I can’t say the implicated schools off head," Ndoro said.

CALA is a part of Agenda 2030, a worldwide agenda that demands that by 2030 nations ought to produce students with lifesaving skills.

Source : Newsday

#### Sydney Chako

Mathematics, Chemistry and Physics teacher at Sytech Learning Academy. From Junior Secondary School to Tertiary Level Engineering Mathematics and Engineering Science.

Subscribe
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.


text:
## What is diode? Formation of PN junction Biasing of Diode characteristics and uses of diode

Diode Diode are the electronic components which conducts current in one direction(unidirectional).A PN  junction is known as a semiconductor diode. Silicon and germanium are used in manufacturing the diode. The schematic symbol of diode is represented by The arrow in the symbol indicates the direction of easier conventional current flow. A diode has the two … Read more


text:
# Factoring Differential

Calculus Level 2

Given $y''+y'=2y$

Where $$y=e^{rx}$$. And $$r$$ has two distinct values (the above equation has two solutions). Find the smallest value of $$r$$

Clarification

• $$y'$$ denotes the first derivative of $$y$$ with respect to $$x$$
• $$y''$$ denotes the second derivative of $$y$$ with respect to $$x$$
×


text:
# Pairs

See the original problem on HackerRank.

You will be given an array of integers and a target value. Determine the number of pairs of array elements that have a difference equal to a target value.

For example, given an array of $$[1, 2, 3, 4]$$ and a target value of $$1$$, we have three values meeting the condition:

$$2-1=1, 3-2=1, 4-3=1$$

### Input Format

The first line contains two space-separated integers and , the size of and the target value.

The second line contains space-separated integers of the array arr.

### Constraints

• $$2 \le n \le 10^5$$
• $$0 \lt k \lt 10^9$$
• $$0 \lt arr[i] \lt 2^{31}-1$$
• each integer $$arr[i]$$ will be unique

### Output Format

An integer representing the number of pairs of integers whose difference is k.

### Sample Input

 1 2  5 2 1 5 3 4 2

### Sample output

 1  3

### Explanation

There are 3 pairs of integers in the set with a difference of 2: [5,3], [4,2] and [3,1] .

## Solutions

A quadratic solution is correct, but it’s too slow and causes some test cases to fail:

  1 2 3 4 5 6 7 8 9 10 11 12  int count = 0; for (auto i=0u; i

To find a better solution, we can turn the problem space of searching pairs into the space of searching one element for each iteration.

We need to find i - j = k, for each i and j. This means, for each i we just need to find if i - k is in the array.

The problem turns into a searching problem where looking up any element needs to be fast. We can use an efficient data struture for this purpose like tree-based sets (such as C++’s std::set or Java’s TreeSet), hash-based sets, etc, or we can simply sort the original array and use binary search.

It’s worth noting that we can make a quadratic solution that passes all the test cases:

  1 2 3 4 5 6 7 8 9 10 11 12 13 14  int count = 0; sort(arr.begin(), arr.end()); for (auto i=0u; i

This is still quadratic but we are lucky enough with the problem test cases just because of sorting data beforehand! If we add an extra test case containing all the numbers from 2 to 100'000 and set k=100'001, we will have a timeout! Basically, we will end up visiting 100'000 elements 100'000 times!

We sort the input array and then we apply the idea above:

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24  #include #include #include #include using namespace std; int main() { int n, k; cin >> n >> k; vector v(n); copy_n(istream_iterator(cin), n, begin(v)); sort(begin(v), end(v)); // i - k = j auto cnt = 0; for (auto x : v) { if (binary_search(begin(v), end(v), x - k)) cnt++; } cout << cnt; }

Using some standard algorithms:

  1 2 3 4 5 6 7 8 9 10  int main() { int n, k; cin >> n >> k; vector v(n); copy_n(istream_iterator(cin), n, begin(v)); sort(begin(v), end(v)); cout << count_if(begin(v), end(v), [&](int curr){ return binary_search(begin(v), end(v), curr-k); }); }

Looking at the previous solution, we notice that for each i, the binary search runs from the beginning of the array. If we change the number we search, we can start the binary search from the current position, cutting down the search space.

Instead of looking for i - k = j, we reverse the equation and look for j + k = i. Since the array is sorted, j+k is always increasing. This means it’s not possible to find i among the elements we have already looked into during the previous iterations.

Here is a working solution:

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22  int main() { int n; cin >> n; int k; cin >> k; vector data; for (size_t i = 0; i < n; i++) { int val; cin >> val; data.push_back(val); } sort(data.begin(), data.end()); size_t count = 0; for (size_t i = 0; i < data.size(); ++i) { if (binary_search(data.begin() + i + 1, data.end(), data[i] + k)) count++; } cout << count; }

An even more fine-tuned version has been proposed by Davide Malvezzi: the search range can be made smaller by setting the end at most k steps far from the beginning (the smaller k than n, the more convenient), and the beginning is either i + 1 or one element after the result of the last successful search.

For example, suppose we have:

 1  1 4 7 9

And we look for pairs whose difference is k=6. When we start, the search spans from 1 to 1+k:

 1 2  1 3 4 5 6 7 8 9 ^ ^

And we find 7:

 1 2  1 3 4 5 6 7 8 9 ^ * ^

Then, we search for 3 + k, but it does not make any sense to start from 4 because the element can’t be found before the result of the previous hit (since the elements are sorted). Instead, we can start from 8 (that is one element next the result of the last hit) straight away:

 1 2  1 3 4 5 6 7 8 9 ^ ^

And we find 9.

Here is the full solution:

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16  int pairs_count = 0; auto prev_start = begin(arr); sort(begin(arr), end(arr)); for(size_t i = 0; i < arr.size() - 1 && prev_start != prev(end(arr)); i++) { auto start = max(begin(arr) + i + 1, prev_start + 1); auto end = min(start + k, arr.end()); auto result = lower_bound(start, end, arr[i] + k); if(*result == arr[i] + k) { prev_start = result; pairs_count++; } } return pairs_count;

Note that we early exit when prev_start == prev(end(arr)): if we reach the end of the array, no other element can contribute to the count (since they are all unique).

Although the complexity is still $$O(N \cdot log N)$$, this solution is a perfect example of exploiting problem constraints (formally, the complexity is $$O(N \cdot log K)$$ but in the worst case $$K > N$$).

An interesting related exercise consists in figuring out which test cases are more or less demanding for the solutions discussed above (e.g. in terms of runtime).

### Using other data structures

Previously showed solutions are based on sort that is $$O(N \cdot logN)$$ + iterating each element and performing binary search that still costs $$O(N \cdot logN)$$. We can still apply linear sorting strategy (e.g. counting sort, radix sort), however the cost of performing the second part of the algorithm is still the same.

As said before, alternative solutions involve using other data structures such as maps, sets and dictionaries because we want to optimize looking up i - k = j (or j + k = i). Hash-based associative containers might decrease the overall complexity of the solution down to $$O(N)$$, on average.

Here is an elegant solution in Erlang by Giancarlo Valente:

 1 2 3  pairs(K, Arr) -> S = sets:from_list(Arr), length([X || X <- Arr, sets:is_element(X + K, S)]).

The same in Python by kernelfolla:

 1 2 3  def pairs(k, arr): s = set(arr) return len([x for x in arr if x+k in s])

Same patterns in C++:

 1 2 3 4 5 6 7 8  int N, K; cin >> N >> K; unordered_set S{ istream_iterator(cin), istream_iterator()}; cout << count_if(begin(S), end(S), [&](int i){ return S.count(i-K); });

### Using arrays intersection

We can use a support array to store each expected sum (a[i] + k). To get how many pairs match the requirement, we can count the number of elements are contained in the intersection of such an array with the input.

Here is a solution in PHP by Roberto Peruzzo:

 1 2 3 4 5  function pairs($k,$arr) { $sum =$arr; array_walk($sum, function(&$item, $key,$k) { $item +=$k; }, $k); return count(array_intersect($arr, \$sum)); }

Here is the same idea in C++:

 1 2 3 4 5 6 7 8 9  int n, k; cin >> n >> k; vector v(n); copy_n(istream_iterator(cin), n, begin(v)); sort(begin(v), end(v)); vector tmp(n); transform(begin(v), end(v), begin(tmp), [=](auto i){ return i + k; }); vector inters; set_intersection(begin(tmp), end(tmp), begin(v), end(v), back_inserter(inters)); cout << inters.size();

A more fluent version with C++ ranges (actually, using all the features available in range-v3):

 1 2  sort(v); std::cout << distance(views::set_intersection(v, views::transform(v, [=](auto i){ return i + k; })));

Here, sorting the input elements hides the dominant cost, whereas set intersection is a linear operation.

We've worked on this challenge in these gyms: modena  milan  padua  rome  turin  bari  polimi  lecce  brianza


text:
## Best HTML Project Ideas & Topics for Beginners | Latest HTML Practice Project Topics to Learn

For those who have even a little bit of interest in programming, creating the very first HTML project is definitely exciting and something to look forward to. Those who are newbies to coding often wonder what sort of project they can work on to be able to either start their development business or to impress their colleagues, college mates, or even their employers.

Most people start with the most basic ways to code when they’re just joining, and that is by learning HTML and CSS. There are many HTML Project Ideas & Topics for Beginners that you can start out with when they’re just learning. The path for every beginner with coding always begins with these two elements, which means that if you want to make something that is creative, you need to have something that will stand out and be innovative.

Getting the right HTML Project Topics is not the easiest thing in the world, which is why we have a few ideas here that can help you out if you’re a beginner with HTML. You can practice these HTML Topics for Students and even save them as a part of your coding portfolio.

## What is HTML?

HTML is a markup language, also called a coding tool, that is used for website development. HTML and CSS are used together to make websites which means that learning HTML is important if you want to work in the niche of web development.

HTML has a very simple learning curve, so you can easily pick it up even if you don’t have any prior programming experience. If you know the basics, then it’s even easier to master this coding language.

It may seem daunting and very challenging in the beginning, but remember that baby steps also mean progress, and this is how you can get better. The best way to learn is to keep practicing, which means that trying out different HTML Practice Project Ideas for Beginners that can help you build your portfolio.

## HTML Practice Projects for Beginners

If you’re a beginner with HTML, then these are some HTML Projects for Students that can help you build up your portfolio and also polish your skills.

### Technical Documentation Page

Even if you’re a beginner with HTML and know the basics of CSS and JavaScript, you can very easily make a technical documentation page. The idea behind this is to make a page where you can click on any one of the topics on the left side of this page, and the associated content will automatically be loaded on the right side.

The making of a technical documentation page is a process that is simple and straightforward with no complexity at all. You need to divide up your webpage into two parts to be able to build this HTML project.

The left side of the page, as mentioned, will have a menu that has all the topics listed from top to bottom, and the right side will have the content that is the documentation that corresponds with each of the topics. You can use JavaScript or CSS bookmark if you want to put in the click function.

### Tribute Page

If you’re a beginner with HTML, then this is one of the simplest ideas that you can work on. Now, a tribute page, as the name suggests, is a page where you show respect or honor to someone that has inspired you or someone that you look up to and admire. To make a page like this, all you need is some fundamental HTML concepts, and you’re good to go.

The first thing you need to do is to make the webpage itself. Then you need to add in the picture of the person this page is about, and all in all the details you wish to, like their personal details, history, achievements, and such. You can also have a section where you write some words of respect for this person and how they’ve helped you if you’d like.

If you want to use CSS for this project, you can, since it will be helpful for you to be able to put in different layouts and styles. Make sure that the page is visually appealing as well with good backgrounds. You can go for pastels or earthy tones, and it’s best to stay away from bright contrasting and loud colors for this, but the choice is ultimately yours.

### Event Page

This is a great project even if you’re a beginner with HTML, and you can even experiment with it. You need to have both CSS and HTML skills for this one. Here you need to create a static page where all the details of an event (product launch, webinar, conference, etc.) are being displayed.

The layout of an event page is very simple too. The header section is where all the names and images of the various speakers with the links will be displayed along with the schedule and the venue of the event. You also need to have a section where the purpose of the event is being described. This is where you will say what the event is for and who is the audience that this is targeted at.

Then section off the page into smaller chunks so that it looks neater and not chaotic. You also need to choose the background color, font color, and font style for the different sections on the page. But be sure that everything complements each other. And add a registration button where people can go ahead and register if they are interested in the event.

### Parallax Website

Building a parallax website is very easy and can be done in a day by someone who is well-versed in HTML concepts, even if they’re beginners. A parallax website in one wherein the background you will see a fixed image, and you can scroll up or down on that page and be able to see different sections of that image. This is a way to give a website a unique and beautiful effect.

You need to section out the page into about three to four parts to make a parallax website. Then choose some background images, align all of them on the page in the various section with the text that is relevant. THen set in the padding and the margin, after which you need to integrate the background-position. To add more stylish elements to the page, you can use CSS.

HTML lays a strong foundation for Web Development which is why we have listed Web Development Project Ideas for Beginners for your reference.

### Survey Form

Many different websites have forms that they use as a strategy to get customer data. A survey form that is well-made can help you get all the relevant information that you need from the target audience, like the pain points, preference, taste, location, job, age, and more.

This is one of the HTML Project Ideas that is a great way for you to test what you know about it while you design a form and structure a webpage. Building a survey form isn’t very easy, but it’s not so complex that it can’t be done. You just need to know the basic tags/input fields and such that are needed to make a form.

Then just use the tags to make text fields, dates, radio buttons, checkboxes, and all the other elements that a form needs. You can use CSS here as well so that your webpage and form have a better look and feel.

### Music Store Page

If you’re a music lover, then a music store page is the perfect experiment for you. You need to know the basics of CSS3 and HTML5 if you want to build this page. The first thing you need to do to make this page is to add a background image that is appropriate and add in a short description of all that you can find on the page.

The header section of the page also needs to have menus that list out songs based on the album, artist, year, genre, and so on. You also need the important and relevant buttons like rewind, stop, start, forward, etc. Add in links and images that are appropriate for the collection of songs available.

On the footer, put in contact details, as well as trial options, subscription packages, in-store purchases, and links for registration.

### Restaurant Website

This is a great project that will give you loads of chances to showcase all of your creativity. A website for a restaurant needs to have several functionalities while also being detailed and elaborate.

Firstly, you need to make a webpage layout that is aesthetic and captivating, and you need to also have various elements there. This means online reservation options, contact information, social media buttons, good images of the different dishes, prices, small descriptions of the food items, a list of the food items themselves, and all the other details that are important.

You can align all of the different beverages and food items with the prices in a grid by using CSS. When you’re making a website for a restaurant, you need to focus on a combination of colors that is eye-catching, neat font styles, and a stylish layout.

If you want to take this up a notch, you can have a photo gallery that has sliding images of all of the various items of food. You can also have the relevant links on this website so that the audience has an easier time navigating through the site.

### Landing Page

This is not really a project that will be best for you if you’re a  beginner with HTML since a strong knowledge of CSS and HTML is needed. But, this is really good practice and will be a great addition to your coding portfolio. Landing pages have a lot of vital elements, and so you need to combine your creativity with the HTML knowledge that you have to make it.

You need to make columns and margins, edit images (resize and crop), make separate sections for the site/content elements, add header and footer, and align the items that are in the columns to make the landing page.

Apart from all of this, you need to also pick the right colors for the page. The colors that you pick have to be ones that complement each other, and each section can have different colors if that is what you want. Just be sure that the page elements aren’t clashing with each other when you use CSS for layout and styling.

### Personal Portfolio Page

You need to be well-versed in CSS3 and HTML5 if you want to make a personal portfolio page. Here you need to make a webpage that has all the standard information you would find in a work portfolio like your interest, niche skills, name, projects, and image. You can also add your CV here and host the entire portfolio on GitHub using your account.

The portfolio page should have two sections, that is the header and the footer. The former will have a menu that highlights all of your personal information, work as well as contact information. You can also add an image of yourself on top of the page and have a short summary of your interests and professional career.

Below all of this, add in a few samples of the work that you’ve done. The footer section will then have all of your social media handles where people can reach you.

### Photography Website

To make a photography website, you need to work with both CSS3 and HTML5 so that you can add in all the needed elements. You need to make a one-page responsive photography website here with those skills.

You need a landing page on top of which you need to add the name and logo of the brand as well as a description of the site. You can put in a gallery with a view button so that the users on the page can go to the section with the images and slide to view all of them.

There are different viewing layouts that you can add in, like a list, grid, and more. Then add in the padding and margin for the page and pick the color combination that you want along with the image size and font style. Use a flexbox for media queries to get a responsiveness quotient.

## Conclusion

HTML and CSS are both the highlights of all of these projects that have been listed out. We recommend that you get a good grasp of both of these before switching to something more complex like Python, PHP, or Python. You need to be comfortable with making HTML projects before you can go ahead and work with more complex projects for development.

You need to keep practicing and working to be better. This is why we have HTML Project Ideas listed here for you. These projects can put all that you’ve learned into practice, and you can highlight them in your CV or even use them to get better opportunities. Once your basics and foundations are right, you can start working on real-world projects that are much bigger and keep challenging yourself as you keep growing.

## CSS url() Function – Definition, Syntax | CSS url Image Path | Examples for Absolute, Relative URL() Function in CSS

If we are talking about background images, we can use @import. CSS has a wide range of properties that can reference an image file, display that file on the image as a part of the element’s background. Of all those, we use CSS Image Syntax url() to load up a resource. From this tutorial, you will find the full details about the CSS URL() function like definition, syntax, supported browsers, properties that accept URL as a Value, and example programs.

## CSS url() Function

To include a file, we use the inbuilt function ie., url() CSS function. The parameter is an absolute URL, a relative URL, or a data URL. The url() function can be passed as a parameter of another CSS function, like the attr() function. Based on the property for which it is a value, the resource queried can be an image, font, or stylesheet. The url() functional representation is the value for the <url> data type.

### Syntax

url( <string> <url-modifier>* )

String indicates the URL or ID of an SVG Shape. (*) asterisk denotes that the preceding group occurs zero or more times.

<URL>

An URL is a relative or Absolute Address or Pointer for which the web resource is included or a data uri in single or double-quotes. Quotes are necessary if an URL includes Parentheses, whitespace, or quotes unless these characters are escaped, or if addresses include control characters above 0x7e. Double Quotes can’t occur inside double quotes and single quotes can’t occur within single quotes unless escaped.

If you want to write an URL without Quotes, you can use a backslash(\) before any paratheses, whitespace characters or single quotes, double quotes that are part of the URL.

Path

It References SVG Shape’s ID — circle, ellipse, line, path, polygon, polyline, or rect by using the shape’s geometry as the path.

<url-modifier>

In the coming future url() function can support specifying a modifier, functional notation, or identifier that alters the URL String Meaning. As of now, it is not fully defined and supported.

### Parameters

This function allows a single parameter url that holds the url in string format. The following examples of url are such as:

<css_property>: url("https://btechgeeks.com/image.png")
<css_property>: url('https://btechgeeks.com/image.png')
<css_property>: url(https://betchgeeks.com/image.png)

### Values

The url() function can be added as a value for background, background-image, list-style, list-style-image,content, cursor, border, border-image,border-image-source, mask, mask-image, src in the context of a @font-face block, and @counter-style/symbol

### Some times url() is Optional

At times, url() functional notation is optional. For suppose when you use the @import rule, you can omit the URL() and simply provide a <string> for the url.

### Absolute Vs Relatieve URL

You can choose between Absolute URL, Relative URL, and Root-Relative URL as the Parameter as all of them are valid.

/* Absolute URL */
background-image: url(http://www.btechgeeks.com/images/image.png);

/* Relative URLs */
background-image: url(image.png);
background-image: url(../images/image.png);

/* Root-relative URL */
background-image: url(/images/image.png);

Also Check:

### Supported Browsers

The browsers supported by url() function are as follows:

• Internet Explorer
• Firefox
• Safari
• Opera

### Properties that accept URL as a Value

• background-image
• border-image
• content
• list-style-image

### Usage of CSS url() function in Filter

If you use an URL as a path for filter the URL needs to meet the following criteria and they are as below

• The Path to an SVG File should be appended with filter ID.
• Should consist ID of the filter if an SVG already exists on the page.
.blur {
filter: url(my-file.svg#svg-blur); /* the URL of an SVG file used as a filter */
}

.inline-blur {
filter: url(#svg-blur); /* the ID of an SVG that is embedded in the HTML page */
}

## Examples using url() in CSS

section {
background-image: url(picture.png);
}

This is a relative URL which means that it will search for the file inside the same folder.

We can go back to one folder:

section {
background-image: url(../picture.png);
}

Or can go into a folder

section {
background-image: url(someFolder/picture.png);
}

Or can directly load from the root folder of the CSS

section {
background-image: url(/picture.png);
}

Or we can directly fetch from some website

section {
background-image: url(https://example.com/picture.png);
}

### Example of Usage in the Content Property

HTML

Item 1

Item 2

Item 3

CSS

li::after {
content: ' - ' url(https://mdn.mozillademos.org/files/16761/star.gif);
}

OUTPUT

## MCQ Quiz Questions with Answers for Class 10 Computer Science

### MCQ Questions for Class 10 HTML with Answers

Q1. HTML is a CBSE2011
(a) package
(b) software
(c) markup language
(d) None of these
Answer: (c) HTML is a markup language which is used to define the layout and attributes of WWW document.

Q2. HTML tags are enclosed in
(a) curly brackets
(b) square brackets
(c) double quotes
(d) angular brackets
Answer: (d) HTML tags are enclosed within angular brackets (< and >).

Q3. Which of the following tag identifies the document as an HTML document?
(a)
(c)
(d)

Answer: (a) tag identifies the document as an HTML document.

Q4. Container elements in HTML require     CBSE 2015
(a) starting tag
(b) ending tag
(c) starting and ending tags
(d) None of the above
Answer: (c) In HTML, container elements are required as both starting and ending tags.

Q5. HTML tags are
(a) in uppercase
(b) case sensitive
(c) in lowercase
(d) not case sensitive
Answer: (d) HTML tags are not case sensitive means we can write tags either in uppercase or lowercase.

Q6. Which type of tags used by HTML?
(a) tags only for image
(b) user defined tags
(c) tags only for linking
(d) fixed tags defined by the language
Answer: (d) HTML provides predefined and fixed tags.

Q7. Which program do you need to write HTML code?
(b) Access
(d) None of these
Answer: (c) From the given options, Notepad is useful program to write HTML code.

Q8. An example of HTML editor is
(b) Dreamweaver
(c) Microsoft Frontpage
(d) All of these
Answer: (d) HTML provides various text editors like Notepad, Dreamweaver etc.

Q9. To create an HTML page, you need
(a) text editor
(b) Web browser
(c) Both (a) and (b)
(d) None of these
Answer: (c) Because text editor is required to write HTML code and Web browser is needed to display the page.

Q10. Which of the following is the correct code of HTML page?

(a)
<TITLE> Hello
</TITLE>

(b)
<TITLE> Hello
</TITLE>

(c)
 Hello

Answer: (b) Because <TITLE> tag must close inside the  tag.

Q11. Tags and text that do not display directly on the page afe placed in
(a) body
(b) table
(d) title
Answer: (c) Information in  tag is not displayed directly in Web page. It is used to identify the matter (tags) used in a Web page.

Q12. A Web page normally consists of
(a) head and body
(b) top and bottom
(c) body and font
(d) body and title
Answer: (a) From the given options, a Web page normally consists of head and body.

Q13. Which section is used for text and tags that are shown directly on your Web pages?
(a) Meta
(c) Body
(d) Table
Answer: (c) Information in  tag is directly displayed on Web pages.

Q14. Where do you place the <TITLE> tag in a HTML?
(a) BODY
(c) TITLE
(d) FONT

Answer: (b) <TITLE> tag is placed in the  tag.

Q15. Which attribute is not supported by a  tag? CBSE 2013
(a) bgcolor
(b) size
(c) text
Answer: (b) size is not an attribute of  tag.

Q16. What will happen if the background image is smaller than the browser’s window?
(a) It will leave a blank space at the bottom of your page
(b) It will be repeated
(c) It will be stretched
(d) It will not be displayed
Answer: (b) When the background image is smaller than the browser’s window then it will be shown in boxes in repeated pattern.

Q17. Why should you specify a background color, if you are using an image for the actual background of your page?
(a) So the text shows up better
(b) The background color will be shown until the image loads
(c) In case the image does not fit right
(d) None of the above
Answer: (b) We have to use background color because if in any case image is not displayed then atleast background color will be shown on that place.

Q18. Which attribute of  tag specifies the color of visited links in a document?
(d) None of these
Answer: (a) vlink attribute specifies the color of visited links in a HTML document.

Q19. Choose the correct HTML tag for the largest heading.
(a)

(b)

(c)

(d)

Answer:(d)
 tag provides the largest heading in HTML.

Q20. Which of the following will give smallest size of the text? CBSE 2014
(a)

(b)

(c)

(d)

Answer: (b) From the given options,
 tag displays the smallest size of heading text.

Q21. In a Web page, you can place
(a) 2 levels of headings
(b) 6 levels of headings
(c) 4 levels of headings
(d) 7 levels of headings
Answer: (b) Web page provides six levels of headings.

Q22. The default alignment for paragraph is
(a) left
(b) right
(c) center
(d) justified
Answer: (a) The align attribute of
 tag provides various alignments like left, right, center and justify. But by default, its alignment is left.

Q23. Which of the following HTML container tags do you apply to text for formatting the text as a paragraph?
(a) <PARAGRAPH> ……. c/PARAGRAPH>
(b) <PARA> ………. </PARA>
(c)
 ………

(d) None of the above
Answer: (c)
…….
 is a container tag, which is used for formatting text.

Q24. Which of the following is not a container element? CBSE 2013
(a) P
(b) B
(c) OL
(d) HR
Answer: (d) HR is an empty tag because it has no closing tag.

Q25. The style element holds the document for setting
(a) font, color and alignment
(b) font, color, alignment and border
(c) color, alignment and border
(d) None of the above
Answer: (b) Because they are used to give a better look and feel to the Web documents.

Q26. The tags used for specifying the style in HTML are
(i)  (ii)  (iii) <M> (iv) <L>
Choose the correct one
(a) (i) and (ii)
(b) (i) and (iii)
(c) (ii) and (iv)
(d) (i), (ii) and (iii)
Answer: (a) Because these two tags are text formatting/styling tags.

Q27. Which of the following tag is used to make a list that lists the items with numbers?
(a)

(b)

(c)

(d) None of these
Answer: (c)
 is the ordered list that starts with a number like 1, A, a, i and I etc.

Q28. Which of the following is not HTML list? CBSE 2013
(a) Ordered
(b) Unordered
(c) Definition
(d) Detailed
Answer: (d) Detailed list is not a type of HTML list.

Q29. In an unordered list, it is necessary to enclose each item in CBSE 2013
(a)
 tag
(b)
 tag
(c)  tag
(d)
 tag
Answer: (a) Each item must be enclosed in
 tag either in ordered list or unordered list.

Q30. Which option do you have while making bulleted lists?
(a) Disc, circle, square
(b) Square, polygon
(c) Disc, circle, rectangle
(d) Disc, oval, polygon
Answer: (a) Bulleted list provides various values like disc, circle and square.

Q31. Which one of the following list type that will create a bulleted list? CBSE 2014
(a) Unordered
(b) Ordered
(c) Definition
(d) All of these
Answer: (a) Unordered list provides various types of bullets like square, disc and circle.

Q32. Which of the following will produce a solid circle bullet when given as value of type with
?
(a) Circle
(b) Disc
(c) Square
(d) Rectangle
Answer: (b) A solid circle bullet use the type disc.

Q33. To create a square bulleted list, use
(a)

(b)

(c) <ULtype=”square”>
(d)

Answer: (c) Square bulleted list is the part of unordered list.

Q34. In an ordered list, each item cannot be preceded with CBSE 2013
(a) Counting numbers
(b) Arabic numbers
(c) Roman numerals
(d) Bullets
Answer: (d) In unordered list, bullets are used while counting numbers, arabic numbers and roman numbers are used in an ordered list.

Q35. To create a numbered list with A, B, … use
(a)

(b)

(c)

(d)

Answer: (a) The given list uses the uppercase letter for each item so, the correct syntax is

Q36. To start a list with number 3, we should write CBSE 2015
(a)

(b) <OLtype=”3″>
(c)

(d) All of these
Answer: (a) The correct syntax for start a list with number 3 is
.

Q37. To start a list using circles, use
(a)

(b)

(c)

(d)

Answer: (d) Because circular list starts with unordered list type circle.

Q38. To start a numbered list with regular numerals, use
(a)

(b)

(c)

(d)

Answer: (b) Because regular numbering is the natural numbers starting from 1, 2, 3, … etc.

Q39. If you want to make a list of items in the form of terms and their descriptions, then you can create a …………. list.
(a) ordered
(b) unordered
(c) definition
(d) nested
Answer: (c) A definition list is a list of items, with a description of each item.

### HTML Class 10 Fill in the Blanks [1 Mark each]

Q1. HTML is a subset of ……… .

Q2. An element that only has a starting tag and no ending tag is ………….. element.

Q3. The tag that requires a opening as well as closing tag is called ………. .

Q4. The attribute topmargin sets a margin alongwith the top of your ………… element.

Q5. ………. attribute of BODY tag helps to set background color.

Q6. The ………… tag is used to define basic font size for the HTML page.

Q7. The ……….. tag is used to make the Web browser ignore anything that the tag contains.

Q8. ……….. tag is used to bring the text to new line. CBSE 2014

Q9. HR tag is used for  ………..     CBSE 2014

Q10. …….. and ……… tags break the line flow.

Q11. ………… attribute of
 tag specifies the width of a horizontal line.

Q12. ……… tag is used to make the text bold.

Q13.
 tag is an ………… element tag.

Q14. To display the text in italics, ………. tag is used and to display in type writer font, ……… tag is used. CBSE 2013

Q15. ………… tag is used to underline the text.

Q16. …………. tag creates a bulleted list. CBSE 2015

Q17. noshade is an attribute of …………. tag.

Q18. The unordered list starts with ………….. tag.

Q19. ……..value of type attribute displays a hollow circle for an unordered lists.

Q20. If you want to display uppercase alphabets instead of numbers, ………… ordered type should you use.

### HTML Class 10 True or False [1 Mark each]

Q1. HTML is a case sensitive Web language.
Answer: False No, you can write your text in both uppercase and lowercase.

Q2. HTML is a programming language CBSE 2015
Answer: False Because it is a markup language.

Q3.  tag is used to define document body.
Answer: False  tag is used to define the document head.

Q4. <TITLE> tag is one of the structural tags of HTML document. CBSE 2015
Answer: True HTML provides four structural tags, these are as follows:
, , <TITLE>, .

Q5. There should be only one  tag in each Web page. CBSE 2014
Answer: True A Web page contains necessarily one  tag and one  tag.

Q6. All HTML document contains only  tag.
Answer: False All HTML document contains various tags.

Q7. bgcolor is an attribute of  tag.
Answer: False It is an attribute of  tag.

Q8. background attribute is used to display image.
Answer: True It is an attribute of  tag used to display background image.

Q9. topmargin is used to specify the distance between the top of the document and top of the browser window.
Answer: True topmargin is an attribute of  tag, which is used to specify the distance between the top of the document and top of the browser window.

Q10. color is an attribute of  tag.
Answer: True It defines color of the text.

### Inserting Images and Links in HTML MCQ Questions

Q1. Web browsers display images in the following format
(a) XBM
(b) JPEG
(c) GIF
(d) All of these
Answer: (d) All of these

Q2. Which tag is used to insert an image in Web page?
(a)
(b)

(c)
(d)

Answer: (c)  tag is used to insert inline image in a Web page.

Q3. The correct HTML code for inserting an image is CBSE 2012
(a)
(b)  image.gif</gif>
(c)
(d) <image src = “image.gif” >
Answer: (c)

Q4. src attribute used with  tag stands for CBSE 2013
(a) screen (b) screen resolution count
(c) source (d) structure

Q5. …………. attribute is used to specify the location of an image file.
(a) alt
(b) src
(c) align
(d) name
Answer: (b) src attribute is used to specify the location of an image file.

Q6. The text specified in the alt attribute is displayed as tooltip in
(a) Internet Explorer
(c) Both (a) and (b)
(d) None of these
Answer: (a) The text specified in alt attribute is displayed as tooltip in Internet Explorer only.

Q7. The alternate text of an image can be displayed by using attribute of the  tag.
(a) src (b) alt
(c) align (d) None of these
Answer: (b) alt attribute of the  tag is used to display the alternate text of an image.

Q8. alt attribute allows CBSE 2016
(b) addition of a border to image
(c) use of an alternative image in place of the specified image
(d) addition of alternative text about an image
Answer: (d) alt attribute allows addition of alternative text about an image.

Q9. The default alignment of images, that are inserted in Web page, is
(a) left
(b) right
(c) inline with text
(d) middle
Answer: (c) An image which is inserted in Web page by default placed inline with text.

Q10. Which is not a valid value in the align attribute of  tag? CBSE 2014,2013
(a) top
(b) center
(c) bottom
(d) right
Answer: (b) center is not a valid value in the align attribute of  tag. To align in center,  tag can be used.

Q11. Why is it important to specify width and height attribute in  tag? CBSE 2013
(a) To ensure that image is not copied
(b) The image will not render without these
(c) To stop the image from loading
(d) Helps the browser to load the Web page faster
Answer: (d) Helps the browser to load the Web page faster.

Q12. When creating a Web document, which unit is used to express an image’s height and width? CBSE 2013
(a) Centimetres
(b) Pixels
(c) Dots per inch
(d) Inches
Answer: (b) Image’s height and width unit are expressed in pixels or in per cent form.

Q13. The  tag is
(a) a container tag
(b) an empty tag
(c) a closing tag
(d) None of these
Answer: (a)  is a container tag, which requires starting as well as matching ending tag.

Q14. ………… is the default color of a hyperlink.
(a) Red
(b) Blue
(c) Green
(d) Black

Q15. The tag used in HTML to link a Web page with other Web page is CBSE 2013
(a)  (b) <h> (c)  (d) <l>
Answer: (a)  anchor tag is used to create links.

Q16. Which tag tells, where a link starts? CBSE 2014
(a) <1> (b) <start>
(c)  (d) None of these
Answer: (c)  tag specify that a link starts, in which, href create a hyperlink.

Q17. Which command should be use to link a page with HTML page? CBSE 2013
(a)
(b) page
(c)
(d)
Answer: (b) page

Q18. With which code you .can make an image works as link? CBSE 2016
(a) Text
(c) <a ref=mailto:Click Here
(d) None of the above

Q19. To create a hyperlinked image
(a) the image tag should be within anchor tag
(b) the anchor tag should be within image tag
(c) the image tag should be before the anchor tag
(d) the image tag should be after the anchor tag
Answer: (a) The image tag should be within anchor tag to create hyperlinked image.

Q20. For internal linking, the section names are provided by attribute of  tag.
(a) title
(b) href
(c) name
(d) None of these
Answer: (c) For internal linking, section names are provided by name attribute.

Q21. Is it possible to link within the current page?
(a) No
(b) Only in framesets
(c) Yes
(d) None of these
Answer: (c) Yes, it is possible to link within the current page, which is called internal linking.

Q22. ………. attribute of the  tag is used to name a section in a Web page to create an internal link.
(a) href
(b) name
(c) align
Answer: (b) name attribute is used to create an internal link.

Q23. …………….. attribute is used to set the color of a link while it is active.
(c) Both
(a) and (b)
(d) None of these
Answer: (b) alink attribute is used to set the color of link while it is active.

Q24. The attribute which is used to send E-mails through a Website.
(a) tomail
(b) mailto
(c) Both
(a) and (b)
(d) None of these
Answer: (b) mailto attribute is used to send E-mails through a Website.

Q25. Choose the correct syntax to create an E-mail link. CBSE 2014
(a)
(b)
(c) email = “abc@xyz.com”>
(d) <amail = “abc@xyz.com”>
Answer: (b)

Q26. To display (X+Y)2, correct HTML code is         CBSE 2013
(a) (X+Y)2
(b) X+Y 2
(c) (X+Y)2
(d) (X +Y)2
Answer: (c) (X+Y) 2 code is correct because superscript have to be placed in between  and  tags.

### Inserting Images and Links in HTML Fill in the Blanks [1 Mark each]

Q1. The  tag is an ………… tag, that means it has no closing tag.

Q2.  tag is used for …………. images. CBSE 2014

Q3. …………… tag is used to create inline images. CBSE 2013, 2012

Q4. ……………. is an attribute of the  tag which specifies the location or URL of the image to be displayed.

Q5. An attribute is an extra piece of information associated with a …………….

Q6. The ait attribute provides …………… for an image.

Q7. The value for alt attribute is a text string of upto ………….. characters.

Q8. An image to be displayed in a Web page has to cover 25% of the browser window horizontally and 50% vertically. The attributes ………… and ………….of the  tag would be used for achieving this.

Q9. attribute is used to give border to an image. CBSE 2016

Q10. ………… is a word or image that when clicked take us to another Web page. CBSE 2013

Q11. ………… tag is used to connect Web pages. CBSE 2014

Q12. ……. are used to connect Web pages. They are created with  tag. CBSE 2016

Q13. The …………. tag is considered to establish a hypertext relationship between the current document and another URL.

Q14. The ………….. attribute is used for specifying the URL of the anchor tag.

Q15. An ……….. link allows a link to another Web page or another Website. CBSE 2011

Q16. The …………….. attribute of  tag is used to provide information or a title for the linked document or Web page.

Q17. An link allows a link to another section on the same or different Web page.

Q18. A visited link on a Website is generally underlined and …………… in color.
Ans. purple

Q19. The default color of alink attribute is ………… .

Q20. ………… is used to change the color of a visited link. CBSE 2016

Q21. Using the ………… type URL, you can create the E-mail hyperlink.

Q22. The tag ……….. is used to create superscripts and …………. tag is used to create subscripts on a Web page.

### Inserting Images and Links in HTML True or False [1 Mark each]

Q1. You can have inserted an image in your Web page which is physically present in your computer.
Answer: True With the help of , we can insert an image in Web page which is present in our computer.

Q2. If the image you are loading in the Web page is not available, then you want a text to appear in the image placeholder, text attribute lets you define this text.
Answer: False The alt attribute is used to define text to appear in the image placeholder, if image is not visible for any reason.

Q3. No value is specified with alt attribute of  tag. CBSE 2012
Answer: False alt attribute provides alternate text for an image if the image is not visible on Web page for any reason.

Q4. String as a value of alt attribute must be enclosed in quotation marks.
Answer: True alt attribute contains string which must be enclosed in quotation marks.

Q5. The general syntax for inline image is .
Answer: True At the place of file name, path of the image is specified. If the image is in the same folder as HTML file, it is not needed to specify full path of an image.

Q6. The default alignment of image is right. CBSE 2014
Answer: False There is no default alignment of image with respect to text in HTML.

Q7. It is not important to specify an integer value as the width of the border of an image.
Answer: False Width takes an integer values that are in pixels.

Q8. The align attribute of the  tag is used to specify the text that is to be displayed in case the browser that does not support graphics.
Answer: False alt attribute is used to specify the text that is to be displayed in case the browser which does not support graphics.

Q9. We can put a border around an image by using width attribute. CBSE 2013
Answer: False We can put a border around an image by using border attribute.

Q10. border is an attribute of  tag. CBSE 2012
Answer: False border is an attribute of  tag.

Q11. The  tag is called the align tag. CBSE 2011
Answer: False The  tag is called anchor tag.

Q12. The anchor tag  signals the beginning of the text.
Answer: False Anchor tag is used to create hyperlinks not text.

Q13. The color of the hyperlinks in an HTML document can be changed.
Answer: True We can change the color of hyperlinks in HTML document.

Q14. Hyperlinks can also be created for links within the same document. Linking within the same document is called external linking.
Answer: False Linking within the same document is called internal linking.

Q15. It is not possible to create link within current document. CBSE 2012
Answer: False You can link various sections of the current document together, which is called internal linking.

Q16. The name attribute of the  tag allows the user to create links within the same document. CBSE 2011
Answer: True Because name attribute defines a name of a section in a document.

Q17. You should include a mailto function in the body of your document to allow user to respond to your Web page.
Answer: True The mailto function is used to send E-mails from the Website.

### Working with Tables in HTML Class 10 MCQ Questions

Question 1.
Which of these tags belong to table? CBSE 2016
(c)
,
,
(d)
,
,<tt>
Answer: (c),
,
,  tags are used with table.

Question 2.
Which of the following tags gives a caption to the table?
(a)

(b)
(c) < frame >
(d) None of these
Answer:(a)
 tag is used to give caption to the table.

Question 3.
Which of the following is used to specify the beginning of a table’s row?
(a)

(b)

(c) <row>
(d) <begin>
Answer:(b)
 tag indicates the beginning of a table’s row.

Question 4.
HTML tag for row is
(a) <colspan>
(b)

(c) <rowspan>
(d)
Answer:  (b) HTML tag for row is
.

Question 5.
Which tag is used to add columns in the tables?
(a) <colspan>
(b)
(c)

(d) None of these
Answer: (b)  is used to add columns in the tables.

Question 6.
The tag is used to specify the individual table data in a table.
(a)

(b)
(c)
(d)

Answer:(b)The  tag is used to specify the individual table data in a table.

Question 7.
In order to add border to a table, border attribute is specified in which tag?
(a)
(b)

(c)
(d)

Answer:(b) border attribute is specified in
 tag.

Question 8.
The attribute used to set the border color of a table is
(a) border
(b) bordercolor
(c) color
(d) border color
Answer:(b) bordercolor is used to set the border color of a table.

Question 9.
The frame attribute contains types of values.
(a) 9
(b) 3
(c) 6
(d) 4
Answer: (a) The frame attribute contains 9 types of values.

Question 10.
Which of the following is an attribute of
 tag?
(a) src
(d) bold
Answer:(b) cellpadding is an attribute of
 tag.

Question 11.
Which one of the following is not an option for aligning data in a table?
(a) justify
(b) right
(c) left
(d) center
Answer:(a) justify option is not used for aligning data in a table.

Question 12.
Which attribute of the
 tag is used to set an image in the background of a table?
(a) bgcolor
(b) background
(c) frame
(d) rules
Answer:(b) background attribute is used to set an image in the background of a table.

Question 13.
The attribute used to specify the background cofor of a table is
(a) color
(b) bgtable
(c) backcolor
(d) bgcolor
Answer: (d) bgcolor is used to specify the background color of a table.

Question 14.
The two common attributes of the  and the
 tag are
(a) src and height
(b) height and width
(c) border and src .
(d) they do not have any common attributes.
Answer:(b) height and width are common attributes of the  tag and the
 tag.

Question 15.
border, frame, cellspacing, cellpadding, align are the attributes of
(a)  tag
(b)  tag
(c)
 tag
(d) None of these
Answer: (c) border, frame, cellspacing, cellpadding, align are the attributes of
 tag.

Question 16.
Which of the following is not an attribute of
 tag?
(a) border
(b) background
(c) bgcolor
(d) src
Answer:(d) src is not an attribute of
 tag.

Question 17.
In the  tag, td stands for
(a) Table Data
(b) Table Time and Date
(c) Table Date
(d) None of these
Answer:(a) td stands for Table Data.

Question 18.
What is the correct HTML code to left align the content inside a table cell?
(a)
(b)
(c)
(d)
Answer:(b)

Question 19.
Choose the correct HTML code to right align the content inside a table cell.
(a)
(b)
(c)
(d)
Answer: (a)

Question 20.
Combining two or more cells in a table on a Web page is called
(a) merging
(b) spanning
(c) combining
(d) None of these
Answer:(b) Combining two or more cells in a table on a Web page is called spanning.

Question 21.
Which attribute tells, how many rows a cell should span?
(a) colspan = n
(b) rowspan = n
(c) Both (a) and (b)
(d) None of these
Answer:(b) rowspan = n will tell how many rows a cell should span.

Question 22.
rowspan = n can be added to only which tag?
(a)

(b)

(c)
(d)

Answer: (r) rowspan = n can be added to only  tag.

Question 23.
Which attribute of  tag is used to merge two or more columns to form a single column?
(a) colspan
(b) cellspacing
(d) rowspan
Answer: (a) colspan attribute is used to merge two or more columns to form a single column.

Question 24.
colspan = n can be added to tag.
(a)

(b)

(c)
(d)

Answer:(r) colspan = n can be added to  tag.

Question 25.
The attribute helps to align data vertical in a single cell.
(a) align
(b) valign
(c) halig
(d) Both (b) and (c)
Answer:(b) valign attribute is used to align data vertically in a single cell.

Question 26.
In the  tag, th stands for
(d) All of the above
Answer: (c) th stands lor Table Header

### Working with Tables in HTML Class 10 Fill in the Blanks [1 Mark each]

Question 1.
To insert a table on a Web page, we use  ………………. tag.

Question 2.
The tag to start a table is

Question 3.
…………… tag is used to insert data into a table.

Question 4.
The  tag is a …………………

Question 5.
The……………. attribute is used to display a specific portion of a table border.

Question 6.
frame attribute is used with…………attribute.

Question 7.
There are total………… values for rules attribute in
 tag.

Question 8.
In the rules attribute, the………… value helps to display a table border only between rows.

Question 9.
Cellspacing is used to create space between different…………… in a table.

Question 10.
The….. is an attribute of the
 tag to set the distance between the cell content and its boundary.

Question 11.
To set image as background of an HTML table, you can use………………… attribute.

Question 12.
By default, color of a table is…………..

Question 13.
The height and width attributes of
 tag are specified in terms of………….. or percentage.

Question 14.
The… attribute is used to provide information about a table.

Question 15.
 tag can only be present inside……….

Question 16.
The………………. attributes is used to combine the cells vertically.

Question 17.
The……………… attribute is used to span two or more columns in a table.

Question 18.
The……………… attribute is used to align the data vertically within cells.

Question 19.
The
 tag can only be present inside…………tag.

Question 20.
The
 tag is used to specify the………..part of the table.

### Working with Tables in HTML Class 10 True or False [1 Mark each]

Question 1.
A cell is an intersection of a row and a column.
Answer: True A cell is an intersection of a row and a column.

Question 2.
The cellpadding attribute is used with  tag.
Answer: False The cellpadding is used with
 tag.

Question 3.

 is placed just above the
 tag.
Answer:False
 tag is placed inside the
 tag.

Question 4.
 will make the text bold.
Answer:False  is a table data. It is used to define a cell of a table that contains data.

Question 5.
The border is an attribute of  tag.
Answer:F3lSB The border is an attribute of
 tag.

Question 6.
The default value of border attribute is 1.
Answer:False The default value of border attribute is 0.

Question 7.
The cols value in the rules attribute, allows you to display table border only between columns.
Answer:True The cols value in the rules attribute is drawn between columns only.

Question 8.
The cellspacing attribute tells the browser how much space to include between the walls of the table.
Answer:False cellspacing attribute is used to create space between different cells in a table.

Question 9.

 tag gives heading to a Web page.
Answer:False
 tag gives title or caption for the table.

Question 10.
cellpadding attribute is used with  tag.
Answer:False cellpadding attribute is used with
 tag.

Question 11.
The rowspan attribute with
 tag is used to merge more than one cells row wise.
Answer:True The rowspan attribute merges the cells row wise in a table.

Question 12.
The rowspan attribute is used to make a cell span multiple columns.
Answer:False The rowspan attribute is used to make a cell span multiple rows.

Question 13.
The align and valign are the attributes used with  tag to set the alignment of data in a cell.
Answer:True The align and valign attributes are used to set alignment of the data.

Question 14.
The  tag (column setting) have higher priority than
 tag (row setting).
Answer:True The  tag (column setting) have higher priority than
 tag (row setting).

Question 15.
Table row
 tag can accept one attribute.
Answer:False The
 tag can accept many attributes.

Question 16.
‘tag is used to specify the column heading in a table.
Answer:True  tag is used to specify the column heading in a table.

## How to print your HTML with style | CSS Printing with Examples

Here is the complete tutorial on How to print your HTML with style using CSS. By viewing this page, you will get perfect knowledge on CSS printing, @media print rule, and many more concepts related to it. Just click on the links provided below and start learning regarding print CSS.

## CSS Printing

There is a possibility to use CSS for altering the appearance of your web page when it’s printed on paper. You can define one font for the screen version and another for the print version.

The following piece of code defines various font families for screen and print in CSS.

<link rel="stylesheet"
src="print.css"
type="text/css"
media="print" />

## CSS @media Print

If you’ve prepared any responsive design, you’ll then know about the@mediarule. As well as diverse screen sizes, @media also let you target “print” media. Here’s an example:

@media print {
/* These styles will only be used when the page is printed or saved to PDF. */
h1 { font-size: 16pt; }
}

Using this rule, you can define your standard CSS as normal and then join some custom styles that will only be utilized when printing.

p { margin: 1em 0; }

@media print {
/* Hide related article links when printing. */
.related-articles { display: none; }
}

If you want to “zero out” all your standard screen styles and begin from scratch, you can wrap your screen styles in another @media rule:

@media screen {
/* standard styles here. */
}

@media print {
/* print styles here. */
}

## Page break properties

To ensure the content flows evenly over pages, you’ll require control when content gets split among pages. For instance, it looks awkward if a large heading resembles at the bottom of a page – you want it to commence on a new page rather. Likewise, you may want to evade a table spanning multiple pages if possible.

You can make this using page-break-beforepage-break-after, and page-break-inside. Also, You can set the value for these properties to always or avoid.

h1 {
/* h1 elements always start on the top of a new page. */
page-break-before: always;
}

section.city-map {
/* this section always occupies it's own page or pages. */
page-break-before: always;
page-break-after: always;
}

table {
/* tables don't split across pages if possible. */
page-break-inside: avoid;
}

## Repeat table headings

If your document has tables that span many pages, it’ll be difficult to read when printed except the table headers are repeated at the origin of each page. This is moderately easy to accomplish – simply use the thead and tbody elements in your table.

City
Population

Sydney
4.627 million (2018)

## Adding or removing content

Sometimes you may require to add content that’s only displayed when printing. For instance- you might want to link URLs to be printed. You can accomplish this with the help of:after pseudo-element:

@media print {
a[href]:after {
content: " (" attr(href) ")";
}
}

You may also desire to hide or show specific elements only when printing. By combining @media and display this can be made pretty quickly.

/* hide the watermark on screens. */
.watermark {
display: none;
}

@media print {
/* hide the navidation when printing. */
nav {
display: hide;
}
/* show the watermark when printing */
.watermark {
display: initial;
}
}

## Use emulate CSS media for the development.

In order to fasten up your feedback loop while developing, you can arrange your browser to display print styles. To perform this in Chrome on Mac, open developer tools, later use the command-shift-P shortcut for “Run Command” and search for “Emulate CSS print media type”.

Other browsers will have a related feature in their dev tools.

Unfortunately, to view page breaks you’ll require to print to PDF manually every moment.

## Orphans and Widows

The orphans and widows properties manage how the text in an element is split over pages. Sometimes tweaking these values can increase the readability of your printed document.

p {
/* if there aren't at least three lines before the page
break, move the element to the start of a new page. */
orphans: 3;
}

The below-left side orphans is set to 2, so the second paragraph starts before the page break. By settingorphansto 3, as on the right, the paragraph is taken down to the start of the next page.

The widows property is the inverse of orphans – it defines the minimum number of lines that can be at the origin of a new page.

## Advanced tip: the @page rule

With the @page rule, you can tailor-made the page margin for particular pages.

@page:first {
/* No margin on the first page. */
margin: 0;
}

@page {
/* Set a margin on all other pages. */
margin: 2cm;
}

Unfortunately, browser support for this is currently a little inadequate and you can only use the :first:last:left, :right, and:blank pseudo-selectors to choose pages.

## CSS Specificity | Definition, Syntax, Examples | Specificity Rules and Hierarchy of CSS Specificity

In this tutorial, beginners and experienced CSS learners can find the complete guide on Specificity in CSS. Just take a look at the below available direct links and have a quick reference on CSS Specificity.

## What is Specificity in CSS?

CSS Specificity is the set of rules applied to CSS selectors in order to determine which style is applied to an element. The more specific a CSS style is, the higher the point value it accrues, and the likelier it is to be present on the element’s style.

Example:

Roger

In CSS, we can specify like:

.container {
color: yellow;
}

also, we can target the paragraph tags like:

p {
color: red;
}

By understanding how styles are applied, we can ensure the styles we want to display are being rendered.

CSS can quickly become unruly when we don’t stop to think about architecture for our style sheets, and instead throw a ton of CSS selectors around without thinking about specificity.

By making the most of CSS Specificity, we ensure that our code is organized, and our selectors won’t conflict with one another.

## Specificity Rules

Inline CSS>Internal CSS>External CSS

• CSS style implemented by referencing outside stylesheet that has the lowest precedence and is overridden by Internal and inline CSS.
• Internal CSS is overridden by inline CSS.
• Inline CSS has the highest priority and overrides all other selectors.

Example:

<link rel="stylesheet" type="text/css" href="external.css">

Internal CSS overrides external CSS

Inline CSS overrides internal CSS

Output:

## Hierarchy of CSS Specificity

Every element selector has a position in the Hierarchy of specificity in CSS. The following four categories determine the specificity level of a selector:

• An inline style is connected directly to the element to be styled. Example:
.
• IDs – An ID is a unique identifier for the page elements, like #navbar.
• Classes, attributes and pseudo-classes – This category contains .classes, [attributes] and pseudo-classes like :hover, :focus etc.
• Elements and pseudo-elements – This category consists of element names and pseudo-elements, for instance: h1, div, :before and :after.

## How to Calculate Specificity?

Remember the process of calculating specificity by having a glance at the below point.

Begin at 0, add 1000 for style attribute, add 100 for each ID, add 10 for each attribute, class, or pseudo-class, add 1 for each element name or pseudo-element.

Examine these three code fragments:

A: h1
B: #content h1
C:

Heading

Then, the result will produce like this:

The specificity of A is 1 (one element)
The specificity of B is 101 (one ID reference and one element)
The specificity of C is 1000 (inline styling)

As 1 < 101 < 1000, the third rule (C) has a greater level of specificity, and hence it will be implemented.

## How Does it Work?

By following the three buckets of CSS specificity, you can learn at a high level of knowledge on how it falls under:

1. Type Selectors & Pseudo-Element

For Example:

p {
} /* 0 0 0 1 */
span {
} /* 0 0 0 1 */
p span {
} /* 0 0 0 2 */
p > span {
} /* 0 0 0 2 */
div p > span {
} /* 0 0 0 3 */

2. Class Selectors, attribute selectors, and pseudo-class selectors

Example:

.name {
} /* 0 0 1 0 */
.users .name {
} /* 0 0 2 0 */
[href$='.pdf'] { } /* 0 0 1 0 */ :hover { } /* 0 0 1 0 */ 3. ID selectors Example: #name { } /* 0 1 0 0 */ .user #name { } /* 0 1 1 0 */ #name span { } /* 0 1 0 1 */ Also, there is in-line styling which doesn’t use any CSS rather specify the style in-line with the HTML. Example:
Test
 /* 1 0 0 0 */ ## !important Rule There is another property !important that doesn’t follow any specificity rather it is applied overriding all the CSS properties and specificities. p { font-size: 20px !important; } ### Tips on CSS Specificity • The universal selector (*) has no specificity value (0,0,0,0) • Pseudo-elements (e.g. :first-line) get 0,0,0,1 unlike their psuedo-class brethren which get 0,0,1,0 • There’s a highly debatable topic related to using !importantas it overrides all the CSS values. It is also a good practice not to use any id selectors but class selectors. • The pseudo-class : not() adds no specificity by itself, only what’s inside its parentheses. ## How to Setup Tailwind with PurgeCSS and PostCSS? | Tailwind Installation and Usage In this tutorial, we will learn how to use Tailwind with any kind of project. Know how to set up Tailwind with PurgeCSS and PostCSS, how to create a Tailwind File, what do PurgeCSS and PostCSS mean. This tutorial makes you familiar with the concept of How to Remove Unused CSS using the PurgeCSS. ## Tailwind Installation We have to install tailwind via npm or yarn: npm init -y (if its a barebone project, -y stands for yes) npm install tailwindcss ## Create the Configuration File We have to create a configuration for a tailwind to use: npx tailwind init This will create a file named tailwind.config.js in the root location of our project folder. ## PostCSS Config Tailwind Tailwind needs PostCSS (PostCSS is a software development tool that uses JavaScript-based plugins to automate routine CSS operations) and autoprefixer (Autoprefixer will use the data based on current browser popularity and property support to apply prefixes for you) to work. So we need to apply that in the postcss.config.js file: module.exports = { plugins: [ require('tailwindcss'), require('autoprefixer') ] } Note: If the postcss.config.js doesn’t exist, we have to create one. We need to install PostCSS and autoprefixer from npm too: npm install autoprefixer npm install -g postcss-cli (-g stands for global) ## How to Create the Tailwind CSS File? Now, we will create a CSS file (style.css) and add these lines at the top: @tailwind base; @tailwind components; @tailwind utilities; ### Create the build command We need to specify a build command that will help us to generate the actual CSS file after compiling with PostCSS and autoprefixer. For that, we need to add the command to the package.json file at scripts like: "scripts": { "build:css": "postcss src/tailwind.css -o static/dist/tailwind.css" } ### Build Tailwind For building the final CSS file we need to run the command npm run build in the root of the project folder. The resulting file is in static/dist/tailwind.css ### Automatically regenerate the CSS upon file changes There is a great npm package that will compile our CSS in real-time without running the build command every time after edits. For that we need to install the watch using the command: npm install watch Then we need to edit the package.json file at scripts like: "scripts": { "build:css": "postcss src/tailwind.css -o static/dist/tailwind.css", "watch": "watch 'npm run build:css' ./layouts" } Now for running we simply need to execute the command npm run watch and it’s all good. ## Trim the File Size If we check the final CSS file i.e after building, we can see that it’s huge in size. That large file is never appropriate for web pages. For that, we can actually trim the file to make it smaller than the original. We need to install two more npm packages: npm install cssnano npm install @fullhuman/postcss-purgecss ## What is PurgeCSS? PurgeCSS is a development tool used for removing the unused CSS in a Project. It is the default library to control the Tailwind CSS Bundle Sizes. It removes unused styles and optimizes CSS Build Sizes. ## How to Remove Unused Classes from Tailwind with PurgeCSS? To remove unused CSS we use the following code. Then we add this to our PostCSS configuration file postcss.config.js: const purgecss = require('@fullhuman/postcss-purgecss') const cssnano = require('cssnano') module.exports = { plugins: [ require('tailwindcss'), require('autoprefixer'), cssnano({ preset: 'default' }), purgecss({ content: ['./layouts/**/*.html', './src/**/*.vue', './src/**/*.jsx'], defaultExtractor: content => content.match(/[\w-/:]+(?<!:)/g) || [] }) ] } ### In development, avoid too much processing In development, we can use this just to add prefixes and remove comments. We need to edit the postcss.config.js like: const purgecss = require('@fullhuman/postcss-purgecss') const cssnano = require('cssnano') module.exports = { plugins: [ require('tailwindcss'), process.env.NODE_ENV === 'production' ? require('autoprefixer') : null, process.env.NODE_ENV === 'production' ? cssnano({ preset: 'default' }) : null, purgecss({ content: ['./layouts/**/*.html', './src/**/*.vue', './src/**/*.jsx'], defaultExtractor: content => content.match(/[\w-/:]+(?<!:)/g) || [] }) ] } ## CSS Attribute Selectors | Definition of Attribute selectors in CSS | Syntax & Example Program with Attribute Selectors In CSS, to target elements with certain attributes, there is a possibility by using attribute selectors. The CSS [attribute] selector matches elements on the basis of the presence or value of a given attribute. Let’s get complete knowledge on attribute selectors on CSS by going through these quick links available below. ## Attribute selectors in CSS CSS Attribute Selector is a specific type of selector that is applied to select the HTML elements with a specific attribute and/or attribute(s) value that are associated with it. An attribute selector can be made by putting the attribute — (not obligatory) with a value — within the square brackets ([….]). Let’s check the syntax of CSS Attribute Selectors from the below section. ### Syntax: The following syntax is classified on the basis of an attribute or attribute value while styling a specific HTML element: [attribute] [attribute="value"] [attribute~="value"] [attribute|="value"] [attribute^="value"] [attribute$="value"]
[attribute*="value"]

## Attribute presence selectors

One of the first attribute selectors is Attribute presence selectors. By using this attribute selector in CSS, we will check if an element has an attribute using the square brackets[]syntax.

p[key] will select all p (paragraph) tags in the page that have an key attribute, regardless of its value of the content:

p[key] {
/* ... */
}

## Exact attribute value selectors

We can check for an attribute value using the =, then the CSS will only be applied to the attribute matching the exact content:

p[key="my-key"] {
/* ... */
}

## Match an attribute value portion

There are some operators that are used to match an attribute value portion like as follows:

• = it checks for the exact value, and other operators are listed under
• *= notes if the attribute contains the partial
• ^= notes if the attribute starts with the partial
• \$= checks if the attribute ends with the partial
• |= checks if the attribute starts with the partial and it’s followed by a dash (common in classes, for example), or just contains the partial
• ~= checks if the partial is contained in the attribute, but separated by spaces from the rest

If we add anisimply before the closing bracket, the check will be case insensitive. Otherwise, all the checks above are case-sensitive.

## Styling Forms with Attribute Selectors

The attribute selectors are especially helpful for styling forms without class or id. For example, let’s look at the below code:

input[type="text"], input[type="password"] {
width: 150px;
display: block;
margin-bottom: 10px;
background: yellow;
}
input[type="submit"] {
border: 1px solid #804040;
background: #ff8040;
}

Output:

## How to Continuously Rotate an Image using CSS? | CSS Continuous Image Rotation

If you are searching for a code in CSS that can rotate any image? Then this is the right tutorial you are looking for. We have covered everything like How to Continuously Rotate an Image using CSS Animations.

Image Element has three classes namely rotate, linear, infinite. In CSS Stylesheet we need to create a declaration block for each class. These classes are called utility or helper classes.

## .rotate Code Block Declaration

.rotate {
animation: rotation 2s;
}

This will not make anything. We can add an animation property to the element to rotate it:

animation: rotation 2s infinite linear;

Or we can add a class namely rotate to a particular element to target that:

.rotate {
animation: rotation 2s infinite linear;
}

We can tweak the 2s to slow down or speed up the rotation period of the element.

Then we can add the keyframes with transform property for it to make rotation:

@keyframes rotation {
from {
transform: rotate(0deg);
}
to {
transform: rotate(359deg);
}
}

Now the element should rotate. If you reload your browser you will see the image rotating a single time over 2 seconds. If you want to rotate the image continuously you need to change the animation transition timing from default ease to a consistent speed curve known as linear.

Do Check:

## .Linear Code Block Declaration

.linear {
animation-timing-function: linear;
}

Reload your browser tab so that image will rotate to spin from start to end with a consistent speed rate.

## .infinite Code Block Declaration

Let’s us make our image rotate infinitely by declaring our .infinite code block

.infinite {
animation-iteration-count: infinite;
}

We can declare all our animation properties in a single line and a single class as follows

.rotate-image {
animation: rotation 2s linear infinite;
}

This can save a lot of code but for learning purposes, it is better to break things into smaller pieces. You can understand how individual components work.

## CSS Colors | Named Colors in CSS | Ultimate Guide to Learn CSS Color Names with Example

The default HTML pages that are rendered into the browser are pretty bland. For example, it’s just a web page using black and white content and blue links.

We can add colors to CSS to make the webpage more attractive.

For colors in CSS, we have properties like:

• color
• background-color
• border-color

All of them accept the color value when it has in various forms.

This Tutorial of CSS Colors includes the following:

## CSS <color> Keyword

A <color> can be determined in any of the following ways:

• Applying a keyword (such as blue or transparent)
• Using the HSL cylindrical-coordinate system (through the hsl() and hsla() functional notations)
• Using the RGB cubic-coordinate system (via the #-hexadecimal or the rgb() and rgba()functional notations)

The list of 17 original CSS Colors are listed as follows:

Color Keyword Hex Value
black #000000
gray #808080
silver #c0c0c0
white #ffffff
maroon #800000
red #ff0000
purple #800080
fuchsia #ff00ff
green #008000
lime #00ff00
olive #808000
yellow #ffff00
navy #000080
blue #0000ff
teal #008080
aqua #0000ff
orange #ffa500

### Syntax

The syntax of the <color> datatype is defined using one of the options enlisted below.

For Example:

p {
color: red;
}

## Named colors

Previously, CSS started with 16 colors but now we have a wide range of color names list. There are some predefined colors that we can just assign to the CSS, like:

• aliceblue
• antiquewhite
• aqua
• aquamarine
• azure
• beige
• bisque
• black
• blanchedalmond
• blue
• blueviolet
• brown
• burlywood
• chartreuse
• chocolate
• coral
• cornflowerblue
• cornsilk
• crimson
• cyan
• darkblue
• darkcyan
• darkgoldenrod
• darkgray
• darkgreen
• darkgrey
• darkkhaki
• darkmagenta
• darkolivegreen
• darkorange
• darkorchid
• darkred
• darksalmon
• darkseagreen
• darkslateblue
• darkslategray
• darkslategrey
• darkturquoise
• darkviolet
• deeppink
• deepskyblue
• dimgray
• dimgrey
• dodgerblue
• firebrick
• floralwhite
• forestgreen
• fuchsia
• gainsboro
• ghostwhite
• gold
• goldenrod
• gray
• green
• greenyellow
• grey
• honeydew
• hotpink
• indianred
• indigo
• ivory
• khaki
• lavender
• lavenderblush
• lawngreen
• lemonchiffon
• lightblue
• lightcoral
• lightcyan
• lightgoldenrodyellow
• lightgray
• lightgreen
• lightgrey
• lightpink
• lightsalmon
• lightseagreen
• lightskyblue
• lightslategray
• lightslategrey
• lightsteelblue
• lightyellow
• lime
• limegreen
• linen
• magenta
• maroon
• mediumaquamarine
• mediumblue
• mediumorchid
• mediumpurple
• mediumseagreen
• mediumslateblue
• mediumspringgreen
• mediumturquoise
• mediumvioletred
• midnightblue
• mintcream
• mistyrose
• moccasin
• navajowhite
• navy
• oldlace
• olive
• olivedrab
• orange
• orangered
• orchid
• palegoldenrod
• palegreen
• paleturquoise
• palevioletred
• papayawhip
• peachpuff
• peru
• pink
• plum
• powderblue
• purple
• rebeccapurple
• red
• rosybrown
• royalblue
• salmon
• sandybrown
• seagreen
• seashell
• sienna
• silver
• skyblue
• slateblue
• slategray
• slategrey
• snow
• springgreen
• steelblue
• tan
• teal
• thistle
• tomato
• turquoise
• violet
• wheat
• white
• whitesmoke
• yellow
• yellowgreen

also transparent and currentColor which inherits the border-color for example.

We have plenty of options instead of these Named colors.

## RGB and RGBa Color Values

We can usergb()function to get color in the form of RGB which is base on three different colors i.e red, green, and blue. From 0 to 255:

a {
color: rgb(255, 125, 25);
background-color: rgb(125,100, 200);
}

The below table is an example to display few colors utilizing RGB values.

Color Color RGB
rgb(0,0,0)
rgb(255,0,0)
rgb(0,255,0)
rgb(0,0,255)
rgb(255,255,0)
rgb(0,255,255)
rgb(255,0,255)
rgb(192,192,192)
rgb(255,255,255)

rgba() lets us use the alpha channel that creates a transparency effect. That can be a number from 0 to 1:

a {
background-color: rgba(100, 200, 150, 0.5);
}

Probably the most common (yet least intuitive) way to specify colors in CSS is to use their hexadecimal (or hex) values. Hex values are actually just a different way to represent RGB values. Instead of using three numbers between 0 and 255, you use six hexadecimal numbers. Hex numbers can be 0-9 and A-F. Hex values are always prefixed with a # symbol.

ul { color: #8050c8; }    /* purple */

### Shorthand Notation for Hex Values

For instance, in case both digits of the red, green, and blue values are the same, then you may utilize the short three-digit notation as shown in the below example codes.

p { color: #000; }     /* black same as #000000 */
p { color: #fff; }    /* white same as #ffffff */
p { color: #f00; }     /* red: same as #ff0000 */
h1 { color: #0f0; }    /* lime: same as #00ff00 */
ul { color: #ff0; }    /* yellow: same as #ffff00 */

## HSL and HSLa color codes

The HSL color model is one of the least used, but gaining traction because can be more intuitive to use when working with shades and color adjustments.

HSL stands for hue, saturation, and lightness. Hue is defined by a color wheel. Each color represents a degree on the wheel.

Example:

a { background-color: hsl(240,100%, 75%); } /* shade of blue */

HSLA is simply the HSL color model with the addition of an alpha channel. This works exactly the same way as the alpha channel in RGBA.

a { background-color: hsla(240,100%, 75%, 0.5); } /* shade of blue */

## Example Program using CSS Colors Properties

Let’s see an example of CSS colors, which covers the above properties from below.

<title>CSS hsl color property</title>

Hello World. This is RGB format.

Hello World. This is RGBA format.

Hello World. This is Hexadecimal format.

Hello World. This is Short-hexadecimal format.

Hello World. This is HSL format.

Hello World. This is HSLA format.

Hello World. This is Built-in color format.

Output:

## Making a Table Responsive Using CSS | How to Create a Responsive Table using CSS?

Creating a Table can be a quite challenging task especially if we are to make it responsive. Styling the tables can be hectic as not all themes support responsive designs. There is a solution to overcome this and we can use CSS to create responsive designs that fit all screen types. In this tutorial, we have mentioned what is a Responsive Table and How to Create One using CSS by considering necessary syntax, example programs.

## Responsive Tables

Responsive design is completely about adjusting designs to fit screens of different sizes. A Responsive Table will display a horizontal scroll bar if the screen is small to fit the entire content. You can resize the browser window to see the effect.

## How to Create a Responsive Table using CSS?

In order to create a Responsive Table, you need to add the container element with overflow-x:auto around the

...

## CSS Table Properties

Property Description
border Sets the complete border properties in one declaration
border-collapse It indicates whether or not table borders should be collapsed
border-spacing It specifies the distance between adjacent cells borders
caption-side Indicates the placement of a table caption
empty-cells Indicates whether or not to display borders,  background on the table’s empty cells.
table-layout Indicates the layout algorithm to use for a table

## Workaround

We’re going to use “responsive design” principles to detect if the screen is smaller than the maximum height and width of our table. If it is, we will reformat the table.

Just a normal table in HTML is like:

First Name
Last Name
Job Title

Mainak
Das
Intern

Soham
Debnath
Intern

Some style for the table (particularly for desktops and laptops):

table {
width: 100%;
border-collapse: collapse;
}
/* Zebra striping */
tr:nth-of-type(odd) {
background: #eee;
}
th {
background: #333;
color: white;
font-weight: bold;
}
td, th {
border: 1px solid #ccc;
text-align: left;
}

The small screen i.e the screen smaller than the desktop and/or laptop responsive stuff comes in now. We are aware that our minimum table width is about 760px so we will set up our media query to take effect if it is narrower than that. We will focus on iPads as they are right in that zone.

We are going to force the table not to behave as a table by setting every table-related element to be block-level. Then by placing the zebra striping, we have added, it is like each table row becomes a table in itself, and is as wide as the screen. There will be no more horizontal scrolling! For each “cell”, we’ll use CSS generated content (:before) to apply the label, so that we are aware of what each bit of data means.

/*
Max width before this PARTICULAR table gets nasty
This query will take effect for any screen smaller than 760px
and also iPads specifically.
*/
@media
only screen and (max-width: 760px),
(min-device-width: 768px) and (max-device-width: 1024px)  {

/* Force table to not be like tables anymore */
table, thead, tbody, th, td, tr {
display: block;
}

/* Hide table headers (but not display: none;, for accessibility) */
position: absolute;
top: -9999px;
left: -9999px;
}

tr { border: 1px solid #ccc; }

td {
/* Behave  like a "row" */
border: none;
border-bottom: 1px solid #eee;
position: relative;
}

td:before {
/* Now like a table header */
position: absolute;
/* Top/left values mimic padding */
top: 6px;
left: 6px;
width: 45%;
white-space: nowrap;
}

/*
Label the data
*/
td:nth-of-type(1):before { content: "First Name"; }
td:nth-of-type(2):before { content: "Last Name"; }
td:nth-of-type(3):before { content: "Job Title"; }
td:nth-of-type(4):before { content: "Favorite Color"; }
td:nth-of-type(5):before { content: "Wars of Trek?"; }
td:nth-of-type(6):before { content: "Secret Alias"; }
td:nth-of-type(7):before { content: "Date of Birth"; }
td:nth-of-type(8):before { content: "Dream Vacation City"; }
td:nth-of-type(9):before { content: "GPA"; }
td:nth-of-type(10):before { content: "Arbitrary Data"; }
}

And so, desktops and/ or laptops get the regular table experience. Whereas Mobiles and other smaller screens get reformatted and easier to explore table.


text:
# A rectangular box is $6$ feet long and $3$ feet wide. A board $6$ inches wide is fitted into the bottom of the box. Find the length of the board. [closed]

A rectangular box is $$6$$ feet long and $$3$$ feet wide. A board $$6$$ inches wide is fitted into the bottom of the box in this position.

Find the length of the board.

New contributor
Anonymous is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
• Welcome to MSE. Your question is phrased as an isolated problem, without any further information or context. This does not match many users' quality standards, so it may attract downvotes, or be closed. To prevent that, please edit the question. This will help you recognize and resolve the issues. Concretely: please provide context, and include your work and thoughts on the problem. These changes can help in formulating more appropriate answers. Jun 23 at 7:43
• Try and see how Pythagoras might help.... Jun 23 at 8:17
• Please check this answer. You may find the answer to your question there.
– YNK
Jun 23 at 8:33
• Much better to write out the question here than to ask users to chase it offsite. Jun 23 at 9:32
• $lc+6''s=6'$, $ls+6''c=3'$, $c^2+s^2=1$, $c,s>0$ Jun 23 at 13:12


text:
# Equilateral Triangle Bisection

Please help find different equation of (smooth continuous) curves through the centroid of an equilateral triangle bisecting the triangle area $$\Delta$$ into two equal parts.

I could not proceed after starting at a vertex $$\int_{-\pi/6}^{\pi/6}\frac12 r^2 d\theta = \Delta/2$$

• Do you only need an example or you need more? – Luca Goldoni Ph.D. Jan 3 at 9:31
• Derivation of DE of at least one partitioning smooth curve. – Narasimham Jan 3 at 14:26
• OK one possibility is we can start with y = - kx^2 through center and adjust k. – Narasimham Jan 3 at 14:32
• Your choice is good even though it is not what you are searching for. I mean it is not the differential equation. I found many other special ways but not the differential equation. If you want I can post a picture with my general idea. – Luca Goldoni Ph.D. Jan 3 at 15:59
• Please post it as DE can be always found from them. – Narasimham Jan 3 at 19:27

1. We use two bump functions of the kind $$f(x) = \left\{ \begin{gathered} be^{ - \frac{1} {{a^2 - x^2 }}} \,\,\,\,if\,\,\,\, - a \leqslant x \leqslant a \hfill \\ 0\,\,\,\,elsewhere \hfill \\ \end{gathered} \right.$$ and $$g(x)=-f(x)$$.
2. We translate them on the left and on the right of the centroid and we call them $$f_L(x)$$ and $$f_R(x)$$.
3. We define a new function $$F(x)$$ as $$F\left( x \right) = \left\{ \begin{gathered} 0\,\,\,\,\,if\,\,\,\,x \in \left[ {x_A ,x_E } \right] \hfill \\ f_L (x)\,\,\,if\,x \in \left( {x_E ,x_F } \right) \hfill \\ 0\,\,\,if\,\,\,\,x \in \left[ {x_F ,x_L } \right] \hfill \\ f_R (x)\,\,\,if\,x \in \left( {x_L ,x_M } \right) \hfill \\ 0\,\,\,\,\,if\,\,\,\,x \in \left[ {x_M ,x_H } \right] \hfill \\ \end{gathered} \right.$$
Of course you can add as many couples of bump functions as you want and you can play with parameters freely with parameters $$a$$ and $$b$$ as long as the graph of $$f$$ stay inside the triangle and there is an interval where the function $$F$$ is zero containing $$G$$.