HTML interview questions: the company's real html interview questions

Editing typesetting  | Song Dashi

Platform Operation  |

1. Tell me about the classification of elements (labels) and their respective characteristics?

    Block element: It occupies a single line by itself, and the width and height can be set 

    Line block elements: display in the same line, and can set width and height

    Row elements: displayed in the same row, and width and height cannot be set

2. Tell me about your understanding of label semantics?

    Friendly to developers, easier to read and understand, good for code readability

    Friendly to machines, making it easier for search engines to understand, which is good for seo

3. What are the new features of HTML5?

    Added semantic tags, audio and video tags

    Added DOM query --- querySelector() , querySelectorAll()

    Canvas drawing --- draw images with js, can draw some basic graphics, animation, suitable for games

    SVG drawing --- Scalable vector graphics, can draw some basic graphics, suitable for maps

    local storage --- localStorage, sessionStorage

    Offline storage --- Write the resources that need to be stored offline in the cache.manifest file. When there is no network connection, you can access the application normally, and update the cache file when connected to the network

    WebSockt --- a new transmission protocol that realizes full-duplex communication between the browser and the server, saving server resources and bandwidth

    WebWorker --- Create a multi-threaded environment for js, allowing the main thread to create a Worker thread, assign some tasks to the latter to run, and communicate between the main thread and the child thread through messages

4. Tell me what are the advantages and disadvantages of the iframe tag?

    Advantages: can display embedded web pages; asynchronously load slower content, such as advertisements; can communicate across subdomains;

    Disadvantages: iframe will block the onload event of the main page; it is not conducive to search engine identification; increase http requests; it is not easy to manage sub-pages;

    Extended knowledge point: what is a subdomain?

    In the domain name store.yourwebsite.com, "store" is the subdomain, "yourwebsite" is the main domain, and "com" is the domain

5. Tell me about the difference between the tag attributes src and href?

    href is to introduce external resources to download to the document, and use it on the link and a tags

    src means to link external resources, used on img, script

- END -

 

Guess you like

Origin blog.csdn.net/m0_74802419/article/details/130838172