Embed from x.com
Every Post displayed on x.com includes an embed code to easily copy-and-paste into your webpage. Activate the Post menu and select “Embed Post to generate markup to include on your webpage:Convert Post URLs using oEmbed
Programmatically convert a Post URL into embedded Post markup using the oEmbed API. Make embedding a Post in your CMS or app as simple as pasting a Post URL.Customize Post display
Customize an embedded Post for your site’s visual design and display preferences by including extra parameters in your embedded Post HTML.Match your site’s color scheme
An embedded Post supports light and dark color themes. Customize X widgets at the page-level with<meta> elements or add data-* attributes to individual generated <blockquote> elements.
View our embedded Post reference documentation for a full list of embedded Post options.
Don’t show previous Post in conversation thread
A Post may be in reply to another Post. By default, we include a summary of the previous Post in the conversation to provide context. Set an oEmbed query parameter ofhide_thread=true or add a data-conversation="none" attribute to the resulting <blockquote> element to prevent the display of a parent Post.
Hide photos, videos, and Cards
A Post may include a photo, video, or link to or other content supporting a Card. By default, this media is displayed in embedded Posts. You can hide this media if editorially desired. Set an oEmbed query parameter ofhide_media=true or add a data-cards="hidden" attribute to the resulting <blockquote> element to prevent expanded content display.
Customize Alignment
An embedded Post is aligned left by default. The Post can be center or right aligned if preferred using the align customization. While historically CSS provides numerous hacks for centering content on a web page, this is the recommended and official supported method.Render a Post with JavaScript
Our widget JavaScript scans the DOM on execution, convertingblockquote.twitter-tweet elements into fully-rendered embedded Posts based on element content.
If dynamically inserting new content into a page, pass the new document fragment to twttr.widgets.load() to initialize embedded Post content.
To directly render an embedded Post at runtime use the twttr.widgets.createTweet() function.