编程小贴士

给你的编程提供小点子


块级元素 vs 内联元素

HTML的元素可以分为两种:

  • 块级元素(block level element )
  • 内联元素(inline element )

二者的区别如下:      1. 块级元素独占一行(除非显示修改元素的display属性),内联元素在一行内显示;

2. 块级元素可以设置width、height属性,而内联元素设置这些属性无效;

3. 块级元素的默认width为100%,而内联元素的的width是根据其内容或子元素确定的。

 

二者的相互转化:

块级元素——>内联元素:display:inline;    内联元素——>块级元素:display:block;

 

介于二者之间的状态:

设置display:inline-block;属性,使元素对外表现为行内元素,在一行内显示;对内表现为块级元素,能设置width、height属性。

 

常见的块级元素和行内元素

块级元素:div p h1 h2 h3 h4 h5 h6 dl ul ol li table hr(水平分割线)

内联元素:a img span input(输入框) select(项目选择) textarea(多行文本输入框) sub(下标) sup(上标)

118 Responses to “ 块级元素 vs 内联元素 ”

  1. me suba说道:

    tTvhNX I think it is a nice point of view. I most often meet people who rather say what they suppose others want to hear. Good and well written! I will come back to your site for sure!

  2. this website说道:

    Major thankies for the article.Much thanks again. Will read on

  3. There as noticeably a bundle to find out about this. I assume you made sure good factors in options also.

  4. animal coloring说道:

    Thanks for sharing, this is a fantastic blog.Really thank you! Cool.

  5. italian honey fig How can I insert a tag cloud into my blog @ blogspot?

  6. kivi na bitkoin说道:

    very nice submit, i certainly love this website, keep on it

  7. tui xach nu说道:

    It?s really a great and helpful piece of info. I am glad that you simply shared this helpful info with us. Please keep us informed like this. Thanks for sharing.

  8. Im no professional, but I feel you just crafted an excellent point. You clearly know what youre talking about, and I can seriously get behind that. Thanks for being so upfront and so truthful.

  9. Looking forward to reading more. Great blog.Really looking forward to read more. Awesome.

  10. to learn more说道:

    Wow, amazing blog layout! How long have you been blogging for? you made blogging look easy. The overall look of your web site is fantastic, let alone the content!. Thanks For Your article about sex.

  11. Jak zosta dobrym sprzedawc Sprzeda przez telefon

  12. some genuinely interesting info , well written and generally user friendly.

  13. Nwokolo说道:

    Very interesting info !Perfect just what I was looking for!

  14. thiet ke noel说道:

    Im no pro, but I consider you just crafted a very good point point. You certainly know what youre talking about, and I can really get behind that. Thanks for staying so upfront and so truthful.

  15. This blog is obviously educating and amusing. I have picked a lot of interesting tips out of it. I ad love to visit it again soon. Thanks a bunch!

  16. Womens Ray Ban Sunglasses Womens Ray Ban Sunglasses

  17. Thanks for the blog post.Really thank you! Much obliged.

  18. Rihanna说道:

    There is perceptibly a lot to realize about this. I feel you made various nice points in features also.

  19. gading bola说道:

    Is anyone else having this issue or is it a issue on my end?

  20. quan ao cho meo说道:

    Wonderful paintings! This is the type of info that should be shared across the web. Shame on Google for no longer positioning this post higher! Come on over and consult with my site. Thank you =)

  21. This web site certainly has all the info I needed concerning this subject and didn at know who to ask.

  22. Piece of writing writing is also a excitement, if you know afterward you can write if not it is complex to write.|

  23. This site was how do I say it? Relevant!! Finally I ave found something which helped me. Many thanks!

  24. make this website yourself or did you hire someone to do it for you?

  25. Pretty! This was an incredibly wonderful article. Many thanks for providing this information.

  26. This blog is obviously cool additionally informative. I have chosen a bunch of useful stuff out of this blog. I ad love to return every once in a while. Thanks a lot!

  27. Thanks-a-mundo for the blog post.Thanks Again. Much obliged.

  28. I’а†ve recently started a web site, the info you provide on this website has helped me tremendously. Thank you for all of your time & work.

  29. Elena Matei说道:

    Thank you for your blog.Much thanks again. Much obliged.

  30. Emmanuel Ekanem说道:

    Svens Bilder Laufen Marathon Triathlon Fotos

  31. stella说道:

    Thankyou for this marvelous post, I am glad I detected this website on yahoo.

  32. we all be familiar with media is a great source of facts.

  33. Thank you for your article post.Really looking forward to read more. Really Cool.

  34. Thank you a lot and I am having a look ahead to contact you.

  35. Crochet说道:

    Lacoste Outlet Online Hi there, just wanted to tell you, I enjoyed this post. It was helpful. Keep on posting!

  36. local说道:

    Regards for helping out, great information.

  37. white shoes说道:

    Salute! Thank you very much for this marvelous website. It was fantastic joy to read.

  38. to read more说道:

    Some really excellent information, Gladiola I observed this.

  39. kouponkabla.com说道:

    There is evidently a bunch to know about this. I feel you made some nice points in features also.

  40. visit website说道:

    Thanks for sharing this first-class write-up. Very inspiring! (as always, btw)

  41. Really enjoyed this blog post.Much thanks again. Much obliged.

  42. School news说道:

    If some one wishes expert view on the topic of running a blog after

  43. Really enjoyed this blog article.Thanks Again. Much obliged.

  44. This particular blog is definitely cool and also factual. I have picked a bunch of helpful things out of this blog. I ad love to return again and again. Thanks a bunch!

  45. Major thankies for the post.Really looking forward to read more. Cool.

  46. Sorry for my bad English.Wow, marvelous blog layout! How long have you been blogging for? you make blogging look easy. The overall look of your site is great, let alone the content!

  47. darey说道:

    I went over this web site and I conceive you have a lot of superb info, saved to my bookmarks (:.

  48. nh punta cana说道:

    Thanks for sharing, this is a fantastic article post. Awesome.

  49. more info说道:

    Thanks-a-mundo for the post.Much thanks again. Great.

  50. Its hard to find good help I am constantnly saying that its hard to find good help, but here is

  51. official site说道:

    There is apparently a bunch to identify about this. I assume you made some good points in features also.

  52. Looking forward to reading more. Great article.Really thank you! Awesome.

  53. This website was how do I say it? Relevant!! Finally I have found something that helped me. Thanks a lot!

  54. That is a good tip particularly to those new to the blogosphere. Brief but very accurate info Many thanks for sharing this one. A must read post!

  55. Yes, you are correct friend, on a regular basis updating weblog is really essential in favor of SEO. Nice discussion keeps it up.

  56. You made some decent points there. I did a search on the topic and found most persons will approve with your site.

  57. Thanks foor a marfelous posting! I really enjoyed reading it,

  58. I value the blog article.Really looking forward to read more. Keep writing.

  59. have a look at说道:

    Usually I don at read article on blogs, but I would like to say that this write-up very compelled me to try and do it! Your writing style has been amazed me. Thanks, very nice post.

  60. Thanks again for the article post.Really looking forward to read more. Really Cool.

  61. app说道:

    This very blog is no doubt interesting additionally amusing. I have picked a bunch of useful tips out of this amazing blog. I ad love to visit it over and over again. Thanks a bunch!

  62. more information说道:

    Wonderful items from you, man. I ave bear in mind your stuff prior to and you are

  63. for more details说道:

    Some truly prize blog posts on this internet site , bookmarked.

  64. You, my pal, ROCK! I found exactly the information I already searched everywhere and simply could not find it. What a great web site.

  65. may bo dam说道:

    Of course, what a splendid blog and illuminating posts, I surely will bookmark your blog.All the Best!

  66. Very good post.Really looking forward to read more.

  67. view说道:

    Thanks for sharing this first-class piece. Very inspiring! (as always, btw)

  68. Kalbos vartojimo uduotys. Lietuvi kalbos pratimai auktesniosioms klasms Gimtasis odis

  69. check here说道:

    This awesome blog is definitely interesting as well as factual. I have picked up a lot of interesting stuff out of this amazing blog. I ad love to go back again soon. Cheers!

  70. Wow! This can be one particular of the most helpful blogs We ave ever arrive across on this subject. Actually Wonderful. I am also a specialist in this topic so I can understand your hard work.

  71. orlando seo说道:

    Very nice article. I absolutely love this website. Thanks!

  72. This website definitely has all of the information I wanted about this subject and didn at know who to ask.

  73. go here说道:

    This is very interesting, You are a very skilled blogger. I ave joined your rss feed and look forward to seeking more of your fantastic post. Also, I have shared your website in my social networks!

  74. Very good article post.Really thank you! Really Great.

  75. I truly appreciate this post. I have been looking everywhere for this! Thank goodness I found it on Bing. You ave made my day! Thanks again!

  76. Im obliged for the post.Much thanks again. Fantastic.

  77. take a look at说道:

    I savour, cause I discovered exactly what I was taking a look for. You ave ended my four day long hunt! God Bless you man. Have a nice day. Bye

  78. Im thankful for the post.Thanks Again. Much obliged.

  79. sbobet说道:

    Very nice post. I definitely appreciate this website. Continue the good work!

  80. daftar sbobet说道:

    Really enjoyed this blog.Thanks Again. Really Cool.

  81. Just thought i would comment and say neat design, did you code it yourself? Looks great. Just found here

  82. phim hai说道:

    Major thankies for the article.Really thank you! Really Cool.

  83. Very good article.Really looking forward to read more. Really Cool.

  84. I think other site proprietors should take this web site as an model, very clean and great user genial style and design, let alone the content. You are an expert in this topic!

  85. What as up, I read your blogs like every week. Your writing style is awesome, keep up the good work!

  86. My brother recommended I might like this website. He was totally right. This post actually made my day. You cann at imagine just how much time I had spent for this information! Thanks!

  87. Wow, amazing blog Wow, amazing blog layout! How long have you been blogging for? you make blogging look easy

  88. Regards for this wondrous post, I am glad I detected this web site on yahoo.

  89. check out说道:

    Keep in the excellent function, I read few articles on this website along with I conceive your web blog is incredibly interesting and contains got companies of fantastic info.

  90. This particular blog is without a doubt awesome additionally informative. I have picked up a lot of helpful tips out of this source. I ad love to come back again soon. Thanks a lot!

  91. clothing store说道:

    Looking forward to reading more. Great post. Will read on

  92. may dieu khac go说道:

    Thank you for helping out, wonderful info. It does not do to dwell on dreams and forget to live. by J. K. Rowling.

  93. pretty handy material, overall I imagine this is really worth a bookmark, thanks

  94. IaаАа’б‚Т€ТšаЂаŒаАа’б‚Т€ТžаБТžve read some good stuff here. Certainly worth bookmarking for revisiting. I wonder how much effort you put to make such a fantastic informative web site.

  95. Usually I don at read article on blogs, however I would like to say that this write-up very compelled me to check out and do so! Your writing taste has been amazed me. Thanks, quite nice article.

  96. Zebra说道:

    I was looking for this particular information for a very long time.

  97. Usually I don at learn post on blogs, but I would like to say that this write-up very compelled me to check out and do so! Your writing taste has been surprised me. Thanks, very nice post.

  98. bitcoin说道:

    You have mentioned very interesting points! ps nice site.

  99. hifu说道:

    I? not that much of a online reader to be honest but your blogs really nice, keep it up! I all go ahead and bookmark your site to come back later on. Cheers

  100. bo dam说道:

    Very neat article.Much thanks again. Keep writing. ventolin

  101. Thanks for great post. I read it with big pleasure. I look forward to the next post.

  102. KS说道:

    I value the article post.Really thank you! Much obliged.

  103. other说道:

    My brother recommended I might like this website. He was totally right. This post actually made my day. You can not imagine just how much time I had spent for this information! Thanks!

  104. There is clearly a lot to know about this. I assume you made various nice points in features also.

  105. Just a smiling visitor here to share the love (:, btw outstanding pattern. Everything should be made as simple as possible, but not one bit simpler. by Albert Einstein.

  106. Say, you got a nice blog post.Really thank you! Awesome.

  107. thoroughly mixed. Promotional merchandise is a great approach to advertise your organization.

  108. Only wanna state that this is very beneficial , Thanks for taking your time to write this.

  109. best pron说道:

    U6xcWz There is visibly a bunch to realize about this. I believe you made certain nice points in features also.

  110. suba me说道:

    10qztQ This site was… how do I say it? Relevant!! Finally I’ve

  111. It as hard to find expert persons by this matter, then again you sound like you already make out what you are talking about! Thanks

  112. Usually I do not learn post on blogs, however I would like to say that this write-up very forced me to check out and do it! Your writing style has been surprised me. Thanks, quite nice post.

  113. Thanks so much for the blog.Thanks Again. Will read on

  114. Muchos Gracias for your blog article.Really thank you! Cool.

  115. Im obliged for your blog. Much many thanks. Keep beginner as guide to.

  116. Right now it looks like WordPress is the best blogging platform out

  117. go there说道:

    I will immediately grab your rss feed as I can at find your e-mail subscription link or newsletter service. Do you ave any? Please let me know in order that I could subscribe. Thanks.

  118. whoah this blog is excellent i love reading your articles. Keep up the good work! You know, a lot of people are looking around for this information, you can aid them greatly.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>