Top 100+ Html Interview Questions And Answers
Question 1. What Is Html?
HTML, or HyperText Markup Language, is a Universal language which permits an character the usage of unique code to create net pages to be considered at the Internet.
Question 2. What Is A Tag?
In HTML, a tag tells the browser what to do. When you write an HTML web page, you enter tags for lots motives -- to exchange the appearance of text, to expose a photo, or to make a link to any other web page.
XML Interview Questions
Question three. What Is The Simplest Html Page?
<TITLE>This is my page title! </TITLE>
This is my message to the sector!
This is my message to the arena!
Question four. How Do I Create Frames? What Is A Frameset?
Frames permit an author to divide a browser window into a couple of (square) areas. Multiple documents can be displayed in a unmarried window, each within its own body. Graphical browsers allow those frames to be scrolled independently of each other, and links can update the report displayed in one body with out affecting the others.
You can't just "upload frames" to an present record. Rather, you have to create a frameset report that defines a specific aggregate of frames, and then display your content material documents internal those frames. The frameset document ought to additionally encompass opportunity non-framed content in a NOFRAMES element. The HTML 4 frames version has widespread design flaws that cause usability problems for web customers. Frames ought to be used best with tremendous care.
Question five. How Can I Include Comments In Html?
Technically, considering that HTML is an SGML application, HTML makes use of SGML remark syntax. However, the total syntax is complicated, and browsers do not assist it in its entirety besides. Therefore, use the following simplified rule to create HTML comments that each have valid syntax and work in browsers:
An HTML remark begins with "<!--", ends with "-->", and does no longer comprise "--" or ">" anywhere inside the remark.
The following are examples of HTML remarks:
* <!-- This is a comment. -->
* <!-- This is another comment,
and it continues onto a second line. -->
Do not placed feedback internal tags (i.E., between "<" and ">") in HTML markup.
HTML 4 Interview Questions
Question 6. What Is A Hypertext Link?
A hypertext hyperlink is a unique tag that hyperlinks one web page to another page or useful resource. If you click the link, the browser jumps to the hyperlink's vacation spot.
Question 7. What Is Everyone Using To Write Html?
Everyone has a distinct choice for which tool works best for them. Keep in mind that generally the much less HTML the device requires you to recognize, the more severe the output of the HTML. In other phrases, you can usually do it higher by using hand in case you make an effort to study a little HTML.
HTML 4 Tutorial HTML five Interview Questions
Question 8. What Is A Doctype? Which One Do I Use?
According to HTML standards, every HTML document starts offevolved with a DOCTYPE assertion that specifies which version of HTML the file makes use of. Originally, the DOCTYPE declaration turned into used simplest by means of SGML-based equipment like HTML validators, which needed to determine which model of HTML a report used (or claimed to use).
Today, many browsers use the record's DOCTYPE statement to decide whether or not to apply a stricter, extra requirements-oriented layout mode, or to apply a "quirks" format mode that attempts to emulate older, buggy browsers.
Question 9. Can I Nest Tables Within Tables?
Yes, a desk may be embedded interior a cellular in another table. Here's a easy example:
<td>that is the first cell of the outer table</td>
<td>this is the second cellular of the outer desk,
with the internal table embedded in it
<td>that is the primary mobile of the internal desk</td>
<td>this is the second one cellular of the inner table</td>
The major caveat approximately nested tables is that older versions of Netscape Navigator have issues with them in case you don't explicitly close your TR, TD, and TH elements. To avoid issues, include every </tr>, </td>, and </th> tag, even though the HTML specifications do not require them. Also, older variations of Netscape Navigator have issues with tables that are nested extremely deeply (e.G., tables nested ten deep). To avoid issues, avoid nesting tables more than a few deep. You can be able to use the ROWSPAN and COLSPAN attributes to reduce desk nesting. Finally, be in particular certain to validate your markup on every occasion you operate nested tables.
HTML+XHTML Interview Questions
Question 10. How Do I Align A Table To The Right (or Left)?
You can use <TABLE ALIGN="right"> to flow a table to the right. (Use ALIGN="left" to go with the flow it to the left.) Any content material that follows the last </TABLE> tag will glide around the table. Use <BR CLEAR="right"> or <BR CLEAR="all"> to mark the stop of the text that is to waft across the table, as shown in this example:
The table in this example will glide to the right.
This text will wrap to fill the to be had space to the left of (and if the text is lengthy sufficient, below) the table.
This text will appear underneath the desk, even though there may be additional room to its left.
Question 11. How Can I Use Tables To Structure Forms?
Small forms are occasionally placed inside a TD element inside a table. This may be a beneficial for positioning a form relative to different content material, but it does not help function the form-associated elements relative to each different.
To position shape-associated elements relative to every different, the whole table ought to be in the shape. You can not start a form in a single TH or TD detail and result in any other. You can't place the form within the table without placing it interior a TH or TD element. You can placed the table within the form, after which use the desk to put the INPUT, TEXTAREA, SELECT, and different shape-associated elements, as shown within the following instance.
<TD><INPUT TYPE="text" NAME="account"></TD>
<TD><INPUT TYPE="password" NAME="password"></TD>
<TD><INPUT TYPE="submit" NAME="Log On"></TD>
Question 12. How Do I Center A Table?
In your HTML, use
In your CSS, use
textual content-align: left;
XML Interview Questions
Question 13. How Do I Use Forms?
The fundamental syntax for a form is: <FORM ACTION="[URL]">...</FORM>
When the form is submitted, the shape information is despatched to the URL specified within the ACTION characteristic. This URL should seek advice from a server-facet (e.G., CGI) program in order to method the shape records. The form itself should contain
* as a minimum one publish button (i.E., an <INPUT TYPE="submit" ...> detail),
* form facts elements (e.G., <INPUT>, <TEXTAREA>, and <SELECT>) as wanted, and
* extra markup (e.G., identifying facts elements, supplying commands) as wished.
HTML 5 Tutorial
Question 14. How Can I Check For Errors?
HTML validators check HTML documents towards a proper definition of HTML syntax after which output a list of errors. Validation is critical to provide the fine hazard of correctness on unknown browsers (both current browsers that you have not seen and destiny browsers that haven't been written but).
HTML checkers (linters) also are beneficial. These applications test documents for particular problems, which include a few because of invalid markup and others due to not unusual browser insects. Checkers may additionally bypass a few invalid documents, and they will fail some legitimate ones.
All validators are functionally equal; at the same time as their reporting patterns may vary, they will find the identical errors given identical enter. Different checkers are programmed to look for unique issues, so their reports will range appreciably from each other. Also, some programs which might be known as validators (e.G. The "CSE HTML Validator") are without a doubt linters/checkers. They are still useful, however they should not be burdened with actual HTML validators.
When checking a domain for errors for the first time, it is often useful to perceive common problems that occur time and again for your markup. Fix those problems anywhere they occur (with an automatic manner if possible), and then cross lower back to discover and fix the final troubles.
Link checkers comply with all the links on a site and report which of them are no longer functioning. CSS checkers file issues with CSS fashion sheets.
Question 15. Do I Have To Memorize A Bunch Of Tags?
No. Most programs that assist you write HTML code already recognise most tags, and create them when you press a button. But you should understand what a tag is, and the way it works. That way you can correct errors for your page more easily.
HTML DOM Interview Questions
Question sixteen. How Do I Make A Form So It Can Be Submitted By Hitting Enter?
The brief answer is that the form should just have one <INPUT TYPE=TEXT> and no TEXTAREA, although it can produce other form factors like checkboxes and radio buttons.
Question 17. How Do I Set The Focus To The First Form Field?
You can not do this with HTML. However, you could include a script after the form that sets the focus to the best subject, like this:
<form id="myform" name="myform" action=...>
<input type="text" id="myinput" name="myinput" ...>
A comparable technique makes use of <body onload=...> to set the point of interest, however a few browsers appear to technique the ONLOAD event earlier than the whole record (i.E., the element with the shape) has been loaded.
Java Interview Questions
Question 18. How Can I Eliminate The Extra Space After A Tag?
HTML has no mechanism to control this. However, with CSS, you may set the margin-bottom of the shape to 0. For instance:
<form style="margin-bottom:0;" action=...>
You can also use a CSS fashion sheet to have an effect on all the bureaucracy on a page:
form margin-bottom: 0 ;
HTML 4 Interview Questions
Question 19. How Can I Show Html Examples Without Them Being Interpreted As Part Of My Document?
Within the HTML example, first update the "&" man or woman with "&" anywhere it takes place. Then replace the "<" individual with "<" and the ">" character with ">" in the same way.
Note that it is able to be appropriate to use the CODE and/or PRE factors when showing HTML examples.
Question 20. How Do I Eliminate The Blue Border Around Linked Images?
In your HTML, you could specify the BORDER attribute for the photo:
<a href=...><img src=... Alt=... Border="0"></a>
However, be aware that removing the border that shows an photo is a link makes it harder for users to differentiate fast and without difficulty which pictures on a web web page are clickable.
CSS Interview Questions
Question 21. How Can I Specify Colors?
If you need others to view your web web page with precise colorings, the most appropriate manner is to indicate the colours with a fashion sheet. Cascading Style Sheets use the colour and heritage-shade houses to specify text and history colors. To keep away from conflicts between the reader's default colors and people advised through the writer, these residences ought to continually be used together.
With HTML, you may advocate colorings with the TEXT, LINK, VLINK (visited hyperlink), ALINK (lively link), and BGCOLOR (heritage coloration) attributes of the BODY element.
Note that these attributes are deprecated with the aid of HTML 4. Also, if the sort of attributes is used, then all of them have to be used to ensure that the reader's default colorations do not interfere with the ones advised through the writer. Here is an example:
<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#000080">
Authors should no longer rely on the required shades given that browsers allow their customers to override document-specific colorations.
Question 22. How Can I Allow File Uploads To My Web Site?
These things are necessary for Web-based totally uploads:
* An HTTP server that accepts uploads.
* Access to the /cgi-bin/ to position the receiving script. Prewritten CGI file-add scripts are to be had.
* A shape implemented some thing like this:
<form method="post" enctype="multipart/form-data" action="fup.Cgi">
File to upload: <input type=file name=upfile><br>
Notes about the document: <input type=text name=note><br>
<input type=submit value=Press> to add the report!
Not all browsers guide shape-primarily based document add, so try to give options wherein possible.
The Perl CGI.Pm module helps document add. The maximum latest variations of the cgi-lib.Pl library additionally assist file upload. Also, in case you need to do document upload in conjunction with shape-to-electronic mail, the Perl package MIME::Lite handles electronic mail attachments.
Question 23. How Can I Require That Fields Be Filled In, Or Filled In Correctly?
Have the server-facet (e.G., CGI) program that approaches the form submission send an errors message if the sector isn't crammed in properly. Ideally, this error message have to consist of a replica of the authentic form with the unique (incomplete or incorrect) facts crammed in because the default values for the shape fields. The Perl CGI.Pm module offers helpful mechanisms for returning partly completed paperwork to the person.
Java Abstraction Interview Questions
Question 24. How Do I Change The Title Of A Framed Document?
The identify displayed is the name of the frameset file as opposed to the titles of any of the pages inside frames. To exchange the name displayed, hyperlink to a brand new frameset record the usage of TARGET="_top" (replacing the complete frameset).
HTML 5 Interview Questions
Question 25. How Do I Link An Image To Something?
Just use the photograph because the link content, like this:
<a href=...><img src=... Alt=...></a>
Question 26. How Do I Specify A Specific Combination Of Frames Instead Of The Default Document?
This is unluckily now not feasible. When you navigate via a domain the usage of frames, the URL will no longer alternate as the documents within the individual frames trade. This way that there may be no way to signify the mixture of documents that make up the current kingdom of the frameset.
The writer can provide more than one frameset files, one for every mixture of frame content. These frameset documents may be generated automatically, perhaps being created at the fly through a CGI application. Rather than linking to person content material files, the writer can link to those separate frameset files using TARGET="_top". Thus, the URL of the cutting-edge frameset record will always specify the combination of frames being displayed, which permits hyperlinks, bookmarks, and so on. To feature typically.
Dynamic HTML Interview Questions
Question 27. How Do I Create A Link?
Use an anchor element. The HREF characteristic specifies the URL of the file that you want to hyperlink to. The following example hyperlinks the text "Web Authoring FAQ" to <URL:http://www.Htmlhelp.Com/faq/html/>:
<A HREF="http://www.Yoursite.Com/faq/html/">Web Authoring FAQ</A>
HTML+XHTML Interview Questions
Question 28. How Do I Create A Link That Opens A New Window?
<a target="_blank" href=...> opens a brand new, unnamed window.
<a target="example" href=...> opens a new window named "example", provided that a window or frame by means of that name does not exist already.
Question 29. How Do I Create A Button Which Acts Like A Link?
This is satisfactory completed with a small shape:
<FORM ACTION="[URL]" METHOD=GET>
<INPUT TYPE=submit VALUE="Text on button">
If you want to line up buttons subsequent to every different, you'll need to placed them in a one-row table, with each button in a separate cellular.
XHTML Interview Questions
Question 30. How Can I Make A Form With Custom Buttons?
Rather than a regular post button (<input type="submit" ...>), you can use the photograph enter type (<input type="image" ...>). The picture enter kind specifies a graphical put up button that capabilities like a server-side photo map.
Unlike regular put up buttons (which return a name=value pair), the photo enter type returns the x-y coordinates of the place wherein the consumer clicked on the image. The browser returns the x-y coordinates as call.X=000 and call.Y=000 pairs.
Ronments, the VALUE and ALT attributes should be set to the same value because the NAME attribute. For example:
<input type="image" name="Send" alt="Send" value="Send" src="send-button.Gif">
Question 31. How Do I Specify Page Breaks In Html?
There isn't any manner in trendy HTML to specify wherein page breaks will occur when printing a web page. HTML became designed to be a device-independent structural definition language, and web page breaks depend upon things just like the fonts and paper length that the individual viewing the page is the use of.
Question 32. How Do I Remove The Border Around Frames?
Removing the border around frames includes both not drawing the frame borders and putting off the gap among the frames. The maximum widely supported manner to show without boundaries frames is <FRAMESET ... BORDER=0 FRAMEBORDER=0 FRAMESPACING=0>.
Note that those attributes are proprietary and now not a part of the HTML four.01 specifications. (HTML four.01 does outline the FRAMEBORDER attribute for the FRAME element, however not for the FRAMESET detail.) Also, doing away with the border round a frame makes it hard to resize it, as this border is likewise utilized in most GUIs to change the scale of the frame.
Question 33. Why Aren't My Frames The Exact Size I Specified?
Older variations of Netscape Navigator appears to convert pixel-primarily based body dimensions to entire possibilities, and to use those percent-based dimensions when laying out the frames. Thus, frames with pixel-based totally dimensions could be rendered with a barely one of a kind length than that specified within the frameset report. The rounding error will range depending on the exact size of the browser window. Furthermore, Navigator seems to save the share-primarily based dimensions internally, as opposed to the original pixel-based dimensions. Thus, while a window is resized, the frames are redrawn based totally on the brand new window length and the vintage percent-based dimensions.
There is no way to save you this behavior. To accommodate it, you must layout your web page to evolve to versions inside the frame dimensions. This is some other situation where it is a superb concept to deal with versions in the browser's presentation.
Question 34. How Can I Specify Background Images?
With HTML, you may recommend a background picture with the BACKGROUND characteristic of the BODY detail. Here is an example:
<body background="imagefile.Gif" bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#000080">
If you specify a history image, you need to also specify text, hyperlink, and background colours because the reader's default shades might not offer ok assessment in opposition to your historical past photo. The background colour can be utilized by the ones no longer the use of your historical past image. Authors ought to no longer rely on the required historical past photo seeing that browsers allow their users to disable image loading or to override file-distinctive backgrounds.
Question 35. How Can I Copy Something From A Webpage To My Webpage?
1: Plaintext or any textual content facts viewable out of your browser can be without difficulty copied like some other text from some other file.
2: HTML and net scripts - you will want to view the internet page's supply code. In the page's supply code, copying the tags in addition to all of the information in-between these tags will typically permit the script to paintings in your web page.
3: Images, sounds, or movies - Almost all pictures, sounds, and films may be copied on your computer after which regarded on your web site. Images may be easily copied from a webpage by way of right-clicking an image and deciding on "Save Picture as" or "Save Image as". Unless the sound or movies document has an immediate hyperlink to download and store the document to a exact vicinity to your tough disk power or to view your Internet browser's cache and locate the sound or movie report saved inside the cache.
4. Embedded objects - Looking on the supply code of the object to decide the call of the record and how it is loaded, and replica both the code and the document.
Question 36. Is It Possible To Make The Html Source Not Viewable?
In brief, there may be no actual approach or script for making preferred HTML supply code not viewable. You may additionally recollect doing any of the under if they may be involved about your supply code.
1. Create the net page in Macromedia Flash or a comparable application. The visitor might want to down load the Macromedia Flash plug-in and would be not able to view the supply code for the flash applet.
2. There are numerous scripts so as to disable the right click feature, preventing the person from saving images or viewing the supply. However, this could not guard the source code of your page. For instance, Internet Explorer customers may also nonetheless click on "View" and "Source" to view the supply code of the page, or a user could disable scripts and pics may be saved with the aid of clearly saving the web page to the tough pressure.
3. There are numerous packages as a way to assist scramble your code, making it hard (no longer impossible) to study. Again, this isn't going to save you someone from viewing your code.
HTML DOM Interview Questions
Question 37. Why Doesn't My Title Show Up When I Click "test It Out"?
You're probably looking at the wrong a part of the display screen. The Title usually suggests up in the Title Bar on the Window, to the left of the reduce/maximize buttons on graphical browsers.
Question 38. What Is The Difference Between The Html Form Methods Get And Post?
The method parameter specifies which approach the purchaser is the usage of to ship information to the WEB server. The method determines which parameter you will discover the CGI request records in:
* POST - post_args
* GET - httpargs
Question 39. How Do I Put Sounds For Older Versions Of Internet Explorer?
For older versions of Internet Explorer, this approach was used <BG SOUND="sound.Ext">.
Question forty. Can I Use Any Html In The Box?
Yes. Any HTML tag that your browser helps will paintings in the field. So you may convey tags from chapters to chapters and mix and suit.
Java Interview Questions
Question forty one. How To Transferring User To New Web Page Automatically?
You will want to use the beneath meta tag.
<META HTTP-EQUIV="Refresh" CONTENT="2"; URL="http://www.Yourname.Com">
Placing the above tag to your <HEAD></HEAD> will load yousite.Com in 2 seconds.
Changing the 2 price on CONTENT="2" to every other fee will increase or decrease the postpone until loading the brand new web page.
Question forty two. How Do I Keep People From Stealing My Source Code And/or Images?
Because copies of your HTML documents and pix are saved in cache, it is not possible to prevent a person from being able to shop them onto their tough pressure. If you're involved approximately your pix, you can wish to embed a watermark along with your facts into the photo. Consult your photo modifying software's assist file for extra info.
CSS Interview Questions
Question forty three. The Colors On My Page Look Different When Viewed On A Mac And A Pc.
The Mac and the PC use barely different coloration palettes. There is a 216 "browser safe" coloration palette that both structures support; the Microsoft coloration picker page has a few top records and links to different resources approximately this. In addition, the two systems use specific gamma (brightness) values, so a photo that looks nice on the Mac may also look too darkish at the PC. The best manner to address this trouble is to tweak the brightness of your photograph so that it looks desirable on each systems.
Question 44. How Do You Create Tabs Or Indents In Web Pages?
There turned into a tag proposed for HTML 3.Zero, but it become in no way adopted with the aid of any primary browser and the draft specification has now expired. You can simulate a tab or indent in various approaches, such as using a obvious GIF, but none are quite as exceptional or broadly supported as an reliable tag might be.
Question 45. My Page Looks Good On One Browser, But Not On Another.
There are slight differences between browsers, including Netscape Navigator and Microsoft Internet Explorer, in areas together with web page margins. The most effective actual answer is to apply popular HTML tags on every occasion viable, and consider your pages in multiple browsers to look how they look.
Question forty six. When I Try To Upload My Site, All My Images Are X's. How Do I Get Them To Load Correctly?
They are a few motives that this will occur. The maximum commonplace are:
1. You're attempting to use a .Bmp or .Tif or different non-supported file layout. You can simplest use .Gif and .Jpg on the web. You ought to convert files that aren't .Gif or .Jpg right into a .Gif or .Jpg along with your image/pics program.
2. You've forgotten to upload the photo files. Double-Check.
Three. You've incorrectly linked to the pix. When you're beginning out, attempt simply the usage of the document call in the <img> tag. If you have got cat.Jpg, use
Four. Image file names are case-touchy. If your file is known as CaT.JpG, you cannot type cat.Jpg, you ought to kind CaT.JpG exactly within the src.
5. If all the above fail, re-upload the photograph in BINARY mode. You may additionally have by chance uploaded the photograph in ASCII mode.
Question forty seven. Why Does The Browser Show My Plain Html Source?
If Microsoft Internet Explorer shows your record commonly, but other browsers show your simple HTML supply, then maximum probably your web server is sending the record with the MIME type "textual content/plain". Your web server needs to be configured to ship that filename with the MIME type "text/html". Often, the usage of the filename extension ".Html" or ".Htm" is all that is necessary. If you are seeing this conduct while viewing your HTML documents to your neighborhood Windows filesystem, then your text editor may additionally have added a ".Txt" filename extension robotically. You should rename filename.Html.Txt to filename.Html so that Windows will treat the report as an HTML record.
Question forty eight. How Can I Display An Image On My Page?
Use an IMG detail. The SRC characteristic specifies the region of the photo. The ALT characteristic provides change textual content for the ones no longer loading photographs. For instance:
<img src="logo.Gif" alt="ACME Products">
Question forty nine. Why Do My Links Open New Windows Rather Than Update An Existing Frame?
If there is no current body with the name you used for the TARGET characteristic, then a brand new browser window might be opened, and this window might be assigned the name you used. Furthermore, TARGET="_blank" will open a new, unnamed browser window.
In HTML four, the TARGET attribute value is case-insensitive, in order that abc and ABC both talk over with the equal body/window, and _top and _TOP each have the same meaning. However, most browsers deal with the TARGET attribute cost as case-touchy and do now not recognize ABC as being similar to abc, or _TOP as having the unique meaning of _top.
Also, a few browsers include a protection characteristic that stops documents from being hijacked through third-party framesets. In these browsers, if a record's hyperlink targets a body described by means of a frameset report this is positioned on a extraordinary server than the document itself, then the hyperlink opens in a new window rather.
Question 50. How Do I Make A Frame With A Vertical Scrollbar But Without A Horizontal Scrollbar?
The most effective way to have a frame with a vertical scrollbar however with out a horizontal scrollbar is to outline the frame with SCROLLING="automobile" (the default), and to have content that doesn't require horizontal scrolling. There isn't any manner to specify that a body ought to have one scrollbar however now not the other. Using SCROLLING="yes" will pressure scrollbars in each instructions (even if they aren't wished), and using SCROLLING="no" will inhibit all scrollbars (even if scrolling is important to access the frame's content material). There aren't any different values for the SCROLLING attribute.
Question 51. What Are The Attributes That Make Up A Dhtml?
DHTML is known as as Dynamic HTML. This is used to boom the interactive potential and the visible impact of the web pages that is loaded in the browser. The predominant technologies which can be used in DHTML are namely:
* CSS which is likewise referred to as as Cascading Style Sheet
* DOM also called as Document Object Model
Question fifty two. What Is Meant By Iframe ?
iframe is used for developing an inline or floating frame. As maximum of understand frames are in particular used to structure the page or for placing a menu bar on the side and so on. But iframe is utilized in a special context. That is in other words iframe is used to embed or insert content material on a web page of padding. This is finished for numerous motives. Say the content can be huge enough that the consumer may additionally wish to place it one by one and scroll thru it.
Question 53. How To Place A Background For A Single Table Cell?
You can positioned a history for a single desk cell in approaches specifically: Either by the use of HTML Using CSS
Question 54. What Are Differences Between Div And Span?
DIV is used to pick a block of text in order that you can apply patterns to it. SPAN is used to select inline textual content and permit customers to apply patterns to it. The principal distinction among DIV and SPAN is SPAN does now not do formatting by way of itself. Also the DIV tag is used as a paragraph smash because it creates a logical department of the file in which it's far applied. This is in evaluation to the SPAN as SPAN sincerely dos the functionality of applying the style and alignment something turned into specified in it. DIV has ALIGN attribute in it which is not present in case of SPAN. Thus DIV is used in cases in which one wants to follow patterns to a block of text. But there may be conditions in which there may not be clean properly established block of textual content to paintings with. In those cases one can favor to apply SPAN which is used to use styles inline. That is in other words DIV is normally used for block of textual content and SPAN is usually used for words or sentences.
Question 55. What Are The Differences Between Cell Spacing And Cell Padding?
Cell padding is used for formatting reason that is used to specify the gap wished between the rims of the cells and also inside the cellular contents. Cell spacing is one extensively utilized f formatting however there's a main difference between cellular padding and mobile spacing. It is as follows: Cell padding is used to set greater area that's used to split cell partitions from their contents. But in assessment mobile spacing is used to set area among cells.
Question fifty six. How Do I Add Scrolling Text To My Page?
Add a Tag of marquee
Question fifty seven. How Do I Close A Browser Window With Html Code?
Use the below code example. < type="button" value="Close this window" onclick="self.Close()">
Question fifty eight. How Do I Do Multiple Colors Of Text?
To do the multicolor text modify the coloration of your font tag as:
< font color="blue">blue
Question 59. What Are Style Sheets?
Style Sheets are templates, very similar to templates in laptop publishing packages, containing a group of regulations declared to various selectors (factors).
Question 60. What Are Cascading Style Sheets?
A Cascading Style Sheet (CSS) is a listing of statements (additionally known as policies) which could assign numerous rendering residences to HTML elements. Style guidelines can be unique for a unmarried detail occurrence, more than one elements, an entire report, or maybe a couple of files right away. It is viable to specify many unique guidelines for an detail in one-of-a-kind places the use of exclusive strategies. All those policies are collected and merged (called a "cascading" of styles) when the record is rendered to shape a single fashion rule for each detail.
Question 61. What Is External Style Sheet? How To Link?
External Style Sheet is a template/report/record containing fashion records which may be connected with any variety of HTML files. This is a totally convenient way of formatting the complete website in addition to restyling it by way of enhancing simply one document. The document is related with HTML documents via the LINK detail in the HEAD element. Files containing fashion statistics have to have extension .Css, e.G. Style.Css.
Question sixty two. Is Css Case Sensitive?
Cascading Style Sheets (CSS) isn't always case touchy. However, font families, URLs to pix, and other direct references with the style sheet can be.
The trick is that in case you write a document using an XML assertion and an XHTML doctype, then the CSS elegance names might be case touchy for a few browsers.
It is a good idea to keep away from naming lessons wherein the best difference is the case, for example:
If the DOCTYPE or XML statement is ever eliminated from your pages, even by means of mistake, the remaining example of the fashion could be used, irrespective of case.
Question 63. What Is Css Rule 'ruleset'?
There are two forms of CSS guidelines: ruleset and at-rule. Ruleset identifies selector or selectors and announces fashion that is to be attached to that selector or selectors. For instance P text-indent: 10pt is a CSS rule. CSS rulesets consist of components: selector, e.G. P and statement, e.G. Textual content-indent: 10pt.
P textual content-indent: 10pt - CSS rule (ruleset)
text-indent: 10pt - CSS statement
text-indent - CSS property
10pt - CSS fee
Question sixty four. 'constant' Background?
There is the possibility to use the HTML tag bgproperties="fixed", but this is IE proprietary, and established upon the 'historical past' attribute (deprecated in HTML4).
With CSS, you may declare the history like:
font-family : "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
background-repeat: no-repeat; /*no-tiling background*/
coloration : #hexcolor;
that shows a heritage-photograph inside the center of the <BODY> element, non-scrolling and non-repeating - in IE or NN6. NN 4.Xx receives the non-repeat-element proper, but stuffs the photograph inside the upper left corner and scrolls ...
Question sixty five. What Is Embedded Style? How To Link?
Embedded fashion is the fashion connected to at least one specific record. The style information is precise as a content of the STYLE detail inside the HEAD detail and will practice to the whole record.
P text-indent: 10pt
Note: The styling guidelines are written as a HTML comment, that is, among <!-- and --> to cover the content material in browsers without CSS help which could otherwise be displayed.
Question sixty six. How Do I Have A Background Image That Isn't Tiled?
Specify the background-repeat property as no-repeat. You also can use the heritage belongings as a shortcut for specifying a couple of background-* residences immediately. Here's an example:
BODY heritage: #FFF url(watermark.Jpg) no-repeat;
Question 67. Why Do Style Sheets Exist?
SGML (of which HTML is a derivative) become meant to be a device-unbiased approach for conveying a report's structural and semantic content material (its that means.) It was in no way meant to deliver bodily formatting information. HTML has crossed this line and now consists of many elements and attributes which specify visual fashion and formatting data. One of the principle reasons for style sheets is to forestall the advent of recent HTML bodily formatting constructs and all over again separate fashion information from document content material.
Question sixty eight. What Is Inline Style? How To Link?
Inline fashion is the fashion attached to 1 particular element. The fashion is distinctive directly in the begin tag as a price of the STYLE characteristic and will apply solely to this specific detail occurrence.
<P STYLE="text-indent: 10pt">Indented paragraph</P>
Question 69. What Is A Style Sheet?
Style sheets are the manner that requirements-compliant Web designers outline the layout, look-and-experience, and layout of their pages. They are referred to as Cascading Style Sheets or CSS. With fashion sheets, a dressmaker can outline many elements of a Web web page:
Style sheets provide you with quite a few energy to define how your pages will look. And another first rate aspect approximately them is that fashion sheets make it truely smooth to replace your pages while you want to make a new layout. Simply load in a new style sheet onto your pages and you are finished.
Question 70. How Do I Place Text Over An Image?
To area textual content or photo over an picture you operate the position assets. The beneath instance is supported through IE 4.Zero. All you have to do is adapt the gadgets on your want.
<div style="position: relative; width: 200px; height: 100px">
<div style="position: absolute; top: 0; left: 0; width: 200px">
<div style="position: absolute; top: 20%; left: 20%; width: 200px">
Text that properly wraps
Question seventy one. Why Does My Content Shift To The Left On Some Pages (in Ff)?
That'll be the pages with more content? The ones which have a vertical scrollbar? If you appearance in IE there may be probably a white area on the right wherein there might be a scrollbar if there had been enough content material to require one. In Firefox, the scrollbar appears when it is needed and the viewport turns into about 20px smaller, so the content material appears to shift to the left while you pass from a page with little content to one with masses of content. It's now not a bug or some thing that needs to be constant, however it does confuse and aggravate a few developers.
If, for a few motive, you want Firefox to continually have scrollbars - whether or not they're wanted or now not - you may do that :
Question seventy two. How Do I Combine Multiple Sheets Into One?
To combine a couple of/partial style sheets into one set the TITLE attribute taking one and the equal cost to the LINK detail. The mixed style will follow as a favored style, e.G.:
<LINK REL=Stylesheet HREF="default.Css" TITLE="combined">
<LINK REL=Stylesheet HREF="fonts.Css" TITLE="combined">
<LINK REL=Stylesheet HREF="tables.Css" TITLE="combined">
Question 73. Which Set Of Definitions, Html Attributes Or Css Properties, Take Precedence?
CSS residences take priority over HTML attributes. If both are certain, HTML attributes could be displayed in browsers with out CSS aid however won't have any impact in browsers with CSS support.
Question 74. Why Call The Subtended Angle A "pixel", Instead Of Something Else (e.G. "subangle")?
In maximum cases, a CSS pixel may be equal to a tool pixel. But, as you point out, the definition of a CSS pixel will sometimes be exclusive. For example, on a laser printer, one CSS pixel can be same to 3x3 device pixels to keep away from printing illegibly small textual content and images. I do not do not forget absolutely everyone ever proposing another call for it. Subangle? Personally, I suppose most of the people could pick the pragmatic "px" to the non-intuitive "sa".
Question 75. Why Was The Decision Made To Make Padding Apply Outside Of The Width Of A 'field', Rather Than Inside, Which Would Seem To Make More Sense?
It makes sense in some situations, however no longer in others. For instance, whilst a child element is set to width: 100%, I don't assume it ought to cover the padding of its parent. The box-sizing assets in CSS3 addresses this difficulty. Ideally, the difficulty ought to were addressed in advance, though.
Question seventy six. Can Css Be Used With Other Than Html Documents?
Yes. CSS can be used with any new york structured record layout. E.G. XML, but, the method of linking CSS with different file types has not been determined but.
Question 77. Can Style Sheets And Html Stylistic Elements Be Used In The Same Document?
Yes. Style Sheets may be left out in browsers without CSS-support and HTML stylistic elements used.
Question seventy eight. How Do I Design For Backward Compatibility Using Style Sheets?
Existing HTML fashion methods (consisting of <font SIZE> and <b>) may be effortlessly mixed with fashion sheet specification methods. Browsers that do not apprehend style sheets will use the older HTML formatting methods, and style sheets specs can manage the advent of those elements in browsers that guide CSS1.
Question seventy nine. Why Use Style Sheets?
Style sheets allow a far extra diploma of layout and show manage than has ever been feasible to date in HTML. The quantity of format coding essential to manipulate display traits can be significantly reduced through the usage of external style sheets which can be utilized by a set of documents. Also, more than one fashion sheets may be included from specific resources to form a cohesive tapestry of styles for a file. Style sheets are also backward compatible - They can be mixed with HTML styling factors and attributes in order that older browsers can view content material as intended.
Question eighty. What Is Css Rule 'at-rule'?
There are forms of CSS rules: ruleset and at-rule. At-rule is a rule that applies to the entire fashion sheet and not to a particular selector best (like in ruleset). They all begin with the @ image followed by using a key-word made up of letters a-z, A-Z, digits 0-nine, dashes and escaped characters, e.G. @import or @font-face.
Question eighty one. What Is Selector?
CSS selector is equivalent of HTML detail(s). It is a string figuring out to which element(s) the corresponding statement(s) will apply and as such the hyperlink between the HTML record and the fashion sheet.
For example in P text-indent: 10pt the selector is P and is known as kind selector because it fits all instances of this element kind in the document.
In P, UL textual content-indent: 10pt the selector is P and UL (see grouping); in .Elegance text-indent: 10pt the selector is .Magnificence (see class selector).
Question 82. What Is Css Declaration?
CSS declaration is fashion connected to a specific selector. It includes two parts; belongings that's equivalent of HTML characteristic, e.G. Textual content-indent: and cost that's equal of HTML cost, e.G. 10pt. NOTE: residences are always ended with a colon.
Question 83. What Is 'essential' Declaration?
Important announcement is a statement with increased weight. Declaration with extended weight will override declarations with everyday weight. If both reader's and writer's style sheet incorporate statements with crucial declarations the writer's announcement will override the reader's.
BODY heritage: white ! Important; color: black
In the instance above the history assets has extended weight whilst the coloration assets has everyday.
Question 84. What Is Cascade?
Cascade is a way of defining the load (significance) of person styling rules consequently permitting conflicting policies to be taken care of out ought to such guidelines apply to the identical selector.
Declarations with accelerated weight take priority over announcement with normal weight:
P color: white ! Critical /* extended weight */
P (shade: black /* ordinary weight */
Question 85. Are Style Sheets Case Sensitive?
No. Style sheets are case insensitive. Whatever is case insensitive in HTML is also case insensitive in CSS. However, parts that are not under control of CSS like font family names and URLs may be case touchy - IMAGE.Gif and photograph.Gif isn't always the same file.
Question 86. How Do I Have A Non-tiling (non-repeating) Background Image?
With CSS, you can use the heritage-repeat belongings. The historical past repeat can be covered within the short hand background property, as in this example:
background: white url(instance.Gif) no-repeat ;
shade: black ;
Question 87. Styles Not Showing?
There are special approaches to use CSS to a HTML document with a stylesheet, and those exceptional ways may be blended:
* inline (internal) (Deprecated for XHTML)
* embedded (inner)
* related (external) and
* @import (external)
Note: An outside stylesheet is a textual content report that contains best CSS Styles. HTML feedback are not alleged to be in there and can cause misinterpretation (> is the CSS "Child" selector!).
Question 88. How Do I Quote Font Names In Quoted Values Of The Style Attribute?
The attribute values can incorporate each unmarried prices and double costs as long as they come in matching pairs. If pair of rates are required encompass single prices in double ones or vice versa:
<P STYLE="font-family: 'New Times Roman'; font-size: 90%">
<P STYLE='font-family: "New Times Roman"; font-size: 90%'>
It's been stated the latter method would not work very well in some browsers, therefore the first one have to be used.
Question 89. What Can Be Done With Style Sheets That Can Not Be Accomplished With Regular Html?
Many of the latest extensions to HTML were tentative and extremely crude tries to manipulate record layout. Style sheets cross several steps beyond, and introduces complicated border, margin and spacing manipulate to most HTML factors. It also extends the abilties added through maximum of the prevailing HTML browser extensions. Background hues or photos can now be assigned to ANY HTML element in place of simply the BODY detail and borders can now be applied to any element rather than just to tables. For greater statistics on the feasible homes in CSS, see the Index DOT Css Property Index.
Question 90. What Is Property?
Property is a stylistic parameter (attribute) that may be prompted via CSS, e.G. FONT or WIDTH. There need to usually be a corresponing fee or values set to every assets, e.G. Font: bold or font: formidable san-serif.
Question ninety one. How Do I Write My Style Sheet So That It Gracefully Cascades With User's Personal Sheet ?
You can help with this with the aid of setting houses in endorsed locations. Style regulations that observe to the complete document have to be set within the BODY det