Search code examples
htmlcsspixeldisplay

I have three doubts about css, pixel display


Are the default elements DISPLAY block? Or is not it all kind? <a> is it inline? AND <p> Is it block?

I used a text-align: center; To centralize a div and worked is it okay to do this? What problems can it have in the future?

The type % helps us programmers q make responsive site and say that the vh, see help too, but then what is doubt I used them however they are fixed values equal the Px is it? Even what I understood?


Solution

    1. Not all the elements are block level elements by default. <a> , <span> are inline elements.

    2. You can use text-align: center in order to make the texts aligned in center. In case if you want to make the div to the center use margin: 0 auto; and set some width value as well.

    3. If use % instead of px, it will take values according to the device width. Suppose you are using some mobile devices say width = 434px then we have mentioned div { width: 100%} that particular div's width is 434px. Most important thing is whenever you are trying to make the responsive web page, make sure that you have added a meta tag in your html.