René's URL Explorer Experiment


Title: 前端学习 第十四天 浅谈 BR 标签[2] · Issue #18 · paddingme/Learning-JavaScript · GitHub

Open Graph Title: 前端学习 第十四天 浅谈 BR 标签[2] · Issue #18 · paddingme/Learning-JavaScript

X Title: 前端学习 第十四天 浅谈 BR 标签[2] · Issue #18 · paddingme/Learning-JavaScript

Description: 前端学习 第十四天 浅谈 BR 标签[2] 昨天了解了
的语义和正确使用场景,今天咱们来了解下
在各浏览器的表现,能不能使用 CSS 样式来改变其表现,能改变哪些样式,以及为什么只能改变这些样式,以及如何改变等问题。
在各浏览器的表现 测试代码: BR DEMO

Open Graph Description: 前端学习 第十四天 浅谈 BR 标签[2] 昨天了解了
的语义和正确使用场景,今天咱们来了解下
在各浏览器的表现,能不能使用 CSS 样式来改变其表现,能改变哪些样式,以及为什么只能改变这些样式,以及如何改变等问题。
在各浏览器的表现 测试代码:

X Description: 前端学习 第十四天 浅谈 BR 标签[2] 昨天了解了 <br> 的语义和正确使用场景,今天咱们来了解下 <br>在各浏览器的表现,能不能使用 CSS 样式来改变其表现,能改变哪些样式,以及为什么只能改变这些样式,以及如何改变等问题。 <br>在各浏览器的表现 测试代码: <!DOCTYPE html> <html lang="...

Opengraph URL: https://github.com/paddingme/Learning-JavaScript/issues/18

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"前端学习 第十四天 浅谈 BR 标签[2]","articleBody":"前端学习 第十四天 浅谈 BR 标签[2]\n\n昨天了解了 `\u003cbr\u003e` 的语义和正确使用场景,今天咱们来了解下  `\u003cbr\u003e`在各浏览器的表现,能不能使用 CSS 样式来改变其表现,能改变哪些样式,以及为什么只能改变这些样式,以及如何改变等问题。\n## `\u003cbr\u003e`在各浏览器的表现\n\n测试代码:\n\n``` html\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"zh-cmn-Hans\"\u003e\n\n\u003chead\u003e\n    \u003cmeta charset=\"UTF-8\"\u003e\n    \u003ctitle\u003eBR DEMO\u003c/title\u003e\n    \u003cstyle\u003e\n    * {\n        margin: 0;\n        padding: 0;\n    }\n    \u003c/style\u003e\n\u003c/head\u003e\n\n\u003cbody\u003e\n    \u003cp\u003e我是一段测试文字\n        \u003cbr\u003e 我来测试下 br 标签各浏览器表现\n    \u003c/p\u003e\n\n\u003c/body\u003e\n\n\u003c/html\u003e\n\n```\n\nchrome 34.0.1847.131 m\n![](http://paddingme.qiniudn.com/chrome.PNG)\n\nfirefox 33.1.1\n![](http://paddingme.qiniudn.com/firefox.PNG)\n\nIE6\n![](http://paddingme.qiniudn.com/IE6.PNG)\nIE7\n![](http://paddingme.qiniudn.com/ie7.PNG)\nIE8\n![](http://paddingme.qiniudn.com/ie8.PNG)\nIE9 \n![](http://paddingme.qiniudn.com/IE9.PNG)\n\nIE 11\n![](http://paddingme.qiniudn.com/ie11.PNG)\n\n综上我们可以得出结论:除了在 Firefox 下 `\u003cbr\u003e` 宽度为0 高度为20px,其余各浏览器均为 宽高auto。\n## 能否使用 CSS 样式来改变其表现\n\nhttp://stackoverflow.com/questions/899252/can-you-target-br-with-css\n\nBR generates a line-break and it is only a line-break. As this element has no content, there are only few styles that make sense to apply on it, like clear or position. You can set BR's border but you won't see it as it has no visual dimension.\n\n由于 `\u003cbr\u003e` 是个空元素,没有内容,只有少数的样式可以使用 如 `clear` 和`position`。当然可以为 `\u003cbr\u003e` 设置 border, 但是你看不见。\n\nIf you like to visually separate two sentences, then you probably want to use the horizontal ruler which is intended for this goal. Since you cannot change the markup, I'm afraid using only CSS you cannot achieve this.\n\nIt seems, it has been already discussed on other forums. Extract from Re: Setting the height of a BR element using CSS:\n\n[T]his leads to a somewhat odd status for BR in that on the one hand it is not being treated as a normal element, but instead as an instance of \\A in generated content, but on the other hand it is being treated as a normal element in that (a limited subset of) CSS properties are being allowed on it.\n\n\u003e br  的奇怪在于:一方面它没有被当作一个正常的元素,而是作为生成内容的实例,但另一方面它被视为正常的元素(有限的子集)的CSS属性被允许。\n\nI also found a clarification in the CSS 1 specification (no higher level spec mentions it):\n\n在 CSS 1 specification 中也有描述:\n\nThe current CSS1 properties and values cannot describe the behavior of the ‘BR’ element. In HTML, the ‘BR’ element specifies a line break between words. In effect, the element is replaced by a line break. Future versions of CSS may handle added and replaced content, but CSS1-based formatters must treat ‘BR’ specially.\n当前CSS1属性和值不能描述的BR元素的行为。 在HTML中,词与词之间的BR元素指定一个换行符。 实际上,取而代之的元素是一个换行符。 CSS的未来版本可能处理添加和替换内容,但CSS1-based格式器必须BR的特别对待。 \n\n\u003e 现在的 CSS1 属性和值不能描述 BR 元素的值。HTML中, 在词与词之间 BR 指定一个折行。实际上其作用被一个换行符取代。CSS的未来版本可能处理添加和替换内容,但CSS1-based格式器必须对 BR 特别对待\n\u003e Grant Wagner's tests show that there is no way to style BR as you can do with other elements. There is also a site online where you can test the results in your browser.\n\nIn theory, HTML BR elements should also be fully styleable. In other words, anything you can apply to EM should also work on BR elements!\n\n.ba { width: 32px; height: 32px; border: 10px solid lime; background: fuchsia; }\n\nBefore\nAfter\n\n.bb { display: none; } /\\* So should not break line! */\nBefore After\n\nNote. The UA stylesheet should use something along the lines of the following to support this element.\n\n   BR:before { content: \"\\A\" }\n","author":{"url":"https://github.com/paddingme","@type":"Person","name":"paddingme"},"datePublished":"2014-11-30T17:46:36.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/18/Learning-JavaScript/issues/18"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:b7c74f21-a140-36bb-f6a2-ab3d7e33c7f5
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB4A2:13E6B4:2A5E956:3D58F07:6A60D646
html-safe-nonceffaf2df59a44c252bb3e00975d312733da009d1a1ed120efcbd2e1e310e4d7e6
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNEEyOjEzRTZCNDoyQTVFOTU2OjNENThGMDc6NkE2MEQ2NDYiLCJ2aXNpdG9yX2lkIjoiODgxNDU3MzM1MzQzOTM4NTE1OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac8efcfc4e51f7fc26a7d3fdb6b2e10b75fb91568520d60ccd93f223740b0ca133
hovercard-subject-tagissue:50464686
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/paddingme/Learning-JavaScript/18/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d4187f8c663bad5d66241175d56b4aff169e3db56ca488748eff34dd2cadf034/paddingme/Learning-JavaScript/issues/18
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d4187f8c663bad5d66241175d56b4aff169e3db56ca488748eff34dd2cadf034/paddingme/Learning-JavaScript/issues/18
og:image:alt前端学习 第十四天 浅谈 BR 标签[2] 昨天了解了
的语义和正确使用场景,今天咱们来了解下
在各浏览器的表现,能不能使用 CSS 样式来改变其表现,能改变哪些样式,以及为什么只能改变这些样式,以及如何改变等问题。
在各浏览器的表现 测试代码:
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamepaddingme
hostnamegithub.com
expected-hostnamegithub.com
None025e511fb0e6dd11aaa36892212f7bcc13708244bc2bcbeff1cf34fc77723812
turbo-cache-controlno-preview
go-importgithub.com/paddingme/Learning-JavaScript git https://github.com/paddingme/Learning-JavaScript.git
octolytics-dimension-user_id5771087
octolytics-dimension-user_loginpaddingme
octolytics-dimension-repository_id25473884
octolytics-dimension-repository_nwopaddingme/Learning-JavaScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id25473884
octolytics-dimension-repository_network_root_nwopaddingme/Learning-JavaScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release405b1f59618e9c5e102e2408c26ce58f1937fbca
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/paddingme/Learning-JavaScript/issues/18#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpaddingme%2FLearning-JavaScript%2Fissues%2F18
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpaddingme%2FLearning-JavaScript%2Fissues%2F18
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=paddingme%2FLearning-JavaScript
Reloadhttps://github.com/paddingme/Learning-JavaScript/issues/18
Reloadhttps://github.com/paddingme/Learning-JavaScript/issues/18
Reloadhttps://github.com/paddingme/Learning-JavaScript/issues/18
paddingme https://github.com/paddingme
Learning-JavaScripthttps://github.com/paddingme/Learning-JavaScript
Notifications https://github.com/login?return_to=%2Fpaddingme%2FLearning-JavaScript
Fork 13 https://github.com/login?return_to=%2Fpaddingme%2FLearning-JavaScript
Star 28 https://github.com/login?return_to=%2Fpaddingme%2FLearning-JavaScript
Code https://github.com/paddingme/Learning-JavaScript
Issues 30 https://github.com/paddingme/Learning-JavaScript/issues
Pull requests 0 https://github.com/paddingme/Learning-JavaScript/pulls
Actions https://github.com/paddingme/Learning-JavaScript/actions
Projects https://github.com/paddingme/Learning-JavaScript/projects
Wiki https://github.com/paddingme/Learning-JavaScript/wiki
Security and quality 0 https://github.com/paddingme/Learning-JavaScript/security
Insights https://github.com/paddingme/Learning-JavaScript/pulse
Code https://github.com/paddingme/Learning-JavaScript
Issues https://github.com/paddingme/Learning-JavaScript/issues
Pull requests https://github.com/paddingme/Learning-JavaScript/pulls
Actions https://github.com/paddingme/Learning-JavaScript/actions
Projects https://github.com/paddingme/Learning-JavaScript/projects
Wiki https://github.com/paddingme/Learning-JavaScript/wiki
Security and quality https://github.com/paddingme/Learning-JavaScript/security
Insights https://github.com/paddingme/Learning-JavaScript/pulse
前端学习 第十四天 浅谈 BR 标签[2]https://github.com/paddingme/Learning-JavaScript/issues/18#top
Mu-Help-Planhttps://github.com/paddingme/Learning-JavaScript/issues?q=state%3Aopen%20label%3A%22Mu-Help-Plan%22
https://github.com/paddingme
paddingmehttps://github.com/paddingme
on Nov 30, 2014https://github.com/paddingme/Learning-JavaScript/issues/18#issue-50464686
https://camo.githubusercontent.com/fb4ffa8bab050dfa884cfc00635cda3d940a8176f0e27f6f95885c846b650433/687474703a2f2f70616464696e676d652e71696e6975646e2e636f6d2f6368726f6d652e504e47
https://camo.githubusercontent.com/84089a7b2462d850e82486a12d753d679c658b7424072dbc5d76958516e008cd/687474703a2f2f70616464696e676d652e71696e6975646e2e636f6d2f66697265666f782e504e47
https://camo.githubusercontent.com/bf4f6f3cc0cb9206576cf897f4914e9b9a8776cacc9fff4d3bdb59ab4ca19ac9/687474703a2f2f70616464696e676d652e71696e6975646e2e636f6d2f4945362e504e47
https://camo.githubusercontent.com/0e67bec58de10b2db37a088f5521ec651b9e6f82ce00b0c52803f46ca0ce8a0a/687474703a2f2f70616464696e676d652e71696e6975646e2e636f6d2f6965372e504e47
https://camo.githubusercontent.com/bc579fb9c23e33d380761b5a399a8526b5b8230485bbbfb1e7bd3deec492f0e1/687474703a2f2f70616464696e676d652e71696e6975646e2e636f6d2f6965382e504e47
https://camo.githubusercontent.com/4c0300ee134da2b5b76e499978d9e5488631ca66f06731050890ccf3162aa4ae/687474703a2f2f70616464696e676d652e71696e6975646e2e636f6d2f4945392e504e47
https://camo.githubusercontent.com/dc3908ee94fde71511bb700a6dafcb26fb39f83ea1f324460c52fd4fc8c4d685/687474703a2f2f70616464696e676d652e71696e6975646e2e636f6d2f696531312e504e47
http://stackoverflow.com/questions/899252/can-you-target-br-with-csshttp://stackoverflow.com/questions/899252/can-you-target-br-with-css
Mu-Help-Planhttps://github.com/paddingme/Learning-JavaScript/issues?q=state%3Aopen%20label%3A%22Mu-Help-Plan%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.