Etiam porta sem malesuada magna mollis euismod. Maecenas faucibus mollis interdum. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
Is foireann uirlisí é Bootstrap ó Twitter atá deartha chun tús a chur le forbairt aipeanna gréasáin agus suíomhanna.
Áiríonn sé bonn CSS agus HTML le haghaidh clóghrafaíocht, foirmeacha, cnaipí, táblaí, eangacha, nascleanúint, agus go leor eile.
Foláireamh nerd: Tá Bootstrap tógtha le Lúide agus dearadh é chun oibriú amach as an geata le brabhsálaithe nua-aimseartha i gcuimhne.
Chun an tús is tapúla agus is éasca a fháil, níl le déanamh ach cóip den phíosa seo isteach i do leathanach gréasáin.
A lucht leanúna ag baint úsáide as Lúide? Fadhb ar bith, ach clónáil an repo agus cuir na línte seo leis:
Íoslódáil, forc, tarraingt, saincheisteanna comhaid, agus níos mó leis an repo oifigiúil Bootstrap ar Github.
Sna laethanta tosaigh de Twitter, bhain innealtóirí úsáid as beagnach aon leabharlann a raibh siad eolach uirthi chun freastal ar riachtanais tosaigh. Thosaigh Bootstrap mar fhreagra ar na dúshláin a tháinig chun cinn agus a tháinig dlús leis an bhforbairt go tapa le linn an chéad seachtain haic ar Twitter.
Le cabhair agus aiseolas ó go leor innealtóirí ag Twitter, tá fás suntasach tagtha ar Bootstrap chun ní hamháin stíleanna bunúsacha a chuimsiú, ach patrúin dearaidh tosaigh níos galánta agus níos marthanaí.
Léigh tuilleadh ar dev.twitter.com ›
Déantar tástáil agus tacaíocht do Bootstrap i mbrabhsálaithe móra nua-aimseartha mar Chrome, Safari, Internet Explorer, agus Firefox.
Tagann Bootstrap le CSS tiomsaithe, gan tiomsú, agus teimpléid shamplacha.
Is é an córas greille réamhshocraithe a chuirtear ar fáil mar chuid de Bootstrap ná greille 16-colún 940px ar leithead. Is blas é den chóras greille 960 a bhfuil an-tóir air, ach gan an corrlach/stuáil bhreise ar an taobh clé agus ar dheis.
Mar a léirítear anseo, is féidir leagan amach bunúsach a chruthú le dhá “cholún,” gach ceann acu a chuimsíonn roinnt de na 16 cholún bhunúsacha a shainmhínigh muid mar chuid dár gcóras greille. Féach ar na samplaí thíos le haghaidh tuilleadh éagsúlachtaí.
- <div rang="row"> aicme = "rá" >
- <div class = "span6 colúin" >
- ...
- </div>
- <div class = "span10 colúin" >
- ...
- </div>
- </div>
Leagan amach bunúsach coimeádán 940px ar leithead, dírithe ar shuíomh nó ar aon leathanach.
- <comhlacht>
- <div class = "container" >
- ...
- </div>
- </corp>
Struchtúr solúbtha leathanach leachtach nó sreabhán le leithead íosta agus uasta agus barra taoibh clé. Go hiontach le haghaidh apps.
- <comhlacht>
- <div class = "container-fluid" >
- <div class = "barra taobh" >
- ...
- </div>
- <div rang = "content" >
- ...
- </div>
- </div>
- </corp>
Ordlathas clóghrafach caighdeánach chun do leathanaigh ghréasáin a struchtúrú.
Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula ut id elit.
Using emphasis, addresses, & abbreviations
<strong>
<em>
<address>
<abbr>
Emphasis tags (<strong>
and <em>
) should be used to indicate additional importance or emphasis of a word or phrase relative to its surrounding copy. Use <strong>
for importance and <em>
for stress emphasis.
Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Maecenas faucibus mollis interdum. Nulla vitae elit libero, a pharetra augue.
Note: It's still okay to use <b>
and <i>
tags in HTML5, but they don't come with inherent styles anymore. <b>
is meant to highlight words or phrases without conveying additional importance, while <i>
is mostly for voice, technical terms, etc.
The <address>
element is used for contact information for its nearest ancestor, or the entire body of work. Here’s how it looks:
Note: Each line in an <address>
must end with a line-break (<br />
) or be wrapped in a block-level tag (e.g., <p>
) to properly structure the content.
For abbreviations and acronyms, use the <abbr>
tag (<acronym>
is deprecated in HTML5). Put the shorthand form within the tag and set a title for the complete name.
<blockquote>
<p>
<small>
To include a blockquote, wrap <blockquote>
around <p>
and <small>
tags. Use the <small>
element to cite your source and you'll get an em dash —
before it.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis dapibus posuere velit aliquet.
Dr. Julius Hibbert
<ul>
<ul.unstyled>
<ol>
dl
<table>
<thead>
<tbody>
<tr>
<th>
<td>
<colspan>
<caption>
Tables are great—for a lot of things. Great tables, however, need a bit of markup love to be useful, scalable, and readable (at the code level). Here are a few tips to help.
Always wrap your column headers in a <thead>
such that hierarchy is <thead>
> <tr>
> <th>
.
Similar to the column headers, all your table’s body content should be wrapped in a <tbody>
so your hierarchy is <tbody>
> <tr>
> <td>
.
All tables will be automatically styled with only the essential borders to ensure readability and maintain structure. No need to add extra classes or attributes.
# | First Name | Last Name | Language |
---|---|---|---|
1 | Some | One | English |
2 | Joe | Sixpack | English |
3 | Stu | Dent | Code |
- <table class="common-table">
- ...
- </table>
Get a little fancy with your tables by adding zebra-striping—just add the .zebra-striped
class.
# | First Name | Last Name | Language |
---|---|---|---|
1 | Some | One | English |
2 | Joe | Sixpack | English |
3 | Stu | Dent | Code |
Note: Zebra-striping is a progressive enhancement not available for older browsers like IE8 and below.
- <table class="common-table zebra-striped">
- ...
- </table>
Taking the previous example, we improve the usefulness of our tables by providing sorting functionality via jQuery and the Tablesorter plugin. Click any column’s header to change the sort.
# | First Name | Last Name | Language |
---|---|---|---|
1 | Your | One | English |
2 | Joe | Sixpack | English |
3 | Stu | Dent | Code |
- <script src="js/jquery/jquery.tablesorter.min.js"></script>
- <script >
- $(function() {
- $("table#sortTableExample").tablesorter({ sortList: [[1,0]] });
- });
- </script>
- <table class="common-table zebra-striped">
- ...
- </table>
All forms are given default styles to present them in a readable and scalable way. Styles are provided for text inputs, select lists, textareas, radio buttons and checkboxes, and buttons.
Add .form-stacked
to your form’s HTML and you’ll have labels on top of their fields instead of to their left. This works great if your forms are short or you have two columns of inputs for heavier forms.
As a convention, buttons are used for actions while links are used for objects. For instance, "Download" could be a button and "recent activity" could be a link.
All buttons default to a light gray style, but a blue .primary
class is available. Plus, rolling your own styles is easy peasy.
Button styles can be applied to anything with the .btn
applied. Typically you’ll want to apply these to only <a>
, <button>
, and select <input>
elements. Here’s how it looks:
Fancy larger or smaller buttons? Have at it!
For buttons that are not active or are disabled by the app for one reason or another, use the disabled state. That’s .disabled
for links and :disabled
for <button>
elements.
One-line messages for highlighting the failure, possible failure, or success of an action. Particularly useful for forms.
For messages that require a bit of explanation, we have paragraph style alerts. These are perfect for bubbling up longer error messages, warning a user of a pending action, or just presenting information for more emphasis on the page.
Modals—dialogs or lightboxes—are great for contextual actions in situations where it’s important that the background context be maintained.
One fine body…
Twipsies are super useful for aiding a confused user and pointing them in the right direction.
Lorem ipsum dolar sit amet illo error ipsum veritatis aut iste perspiciatis iste voluptas natus illo quasi odit aut natus consequuntur consequuntur, aut natus illo voluptatem odit perspiciatis laudantium rem doloremque totam voluptas. Voluptasdicta eaque beatae aperiam ut enim voluptatem explicabo explicabo, voluptas quia odit fugit accusantium totam totam architecto explicabo sit quasi fugit fugit, totam doloremque unde sunt sed dicta quae accusantium fugit voluptas nemo voluptas voluptatem rem quae aut veritatis quasi quae.
Use popovers to provide subtextual information to a page without affecting layout.
Etiam porta sem malesuada magna mollis euismod. Maecenas faucibus mollis interdum. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
Bootstrap was built with Preboot, an open-source pack of mixins and variables to be used in conjunction with Less, a CSS preprocessor for faster and easier web development.
Check out how we used Preboot in Bootstrap and how you can make use of it should you choose to run Less on your next project.
Use this option to make full use of Bootstrap’s Less variables, mixins, and nesting in CSS via javascript in your browser.
- <link rel="stylesheet/less" href="less/bootstrap.less" media="all" />
- <script src = "js/less-1.0.41.min.js" ></script>
Not feeling the .js solution? Try the Less Mac app or use Node.js to compile when you deploy your code.
Here are some of the highlights of what’s included in Twitter Bootstrap as part of Bootstrap. Head over to the Bootstrap website or Github project page to download and learn more.
Variables in Less are perfect for maintaining and updating your CSS headache free. When you want to change a color value or a frequently used value, update it in one spot and you’re set.
- // Links
- @linkColor: #8b59c2;
- @linkColorHover: darken(@linkColor, 10);
- // Grays
- @black: #000;
- @grayDark: lighten(@black, 25%);
- @gray: lighten(@black, 50%);
- @grayLight: lighten(@black, 70%);
- @grayLighter: lighten(@black, 90%);
- @white: #fff;
- // Accent Colors
- @blue: #08b5fb;
- @green: #46a546;
- @red: #9d261d;
- @yellow: #ffc40d;
- @orange: #f89406;
- @pink: #c3325f;
- @purple: #7a43b6;
- // Baseline
- @baseline: 20px;
Less also provides another style of commenting in addition to CSS’s normal /* ... */
syntax.
- // This is a comment
- /* This is also a comment */
Mixins are basically includes or partials for CSS, allowing you to combine a block of code into one. They’re great for vendor prefixed properties like box-shadow
, cross-browser gradients, font stacks, and more. Below is a sample of the mixins that are included with Bootstrap.
- #font {
- .shorthand(@weight: normal, @size: 14px, @lineHeight: 20px) {
- font-size: @size;
- font-weight: @weight;
- line-height: @lineHeight;
- }
- .sans-serif(@weight: normal, @size: 14px, @lineHeight: 20px) {
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
- font-size: @size;
- font-weight: @weight;
- line-height: @lineHeight;
- }
- .serif(@weight: normal, @size: 14px, @lineHeight: 20px) {
- font-family: "Georgia", Times New Roman, Times, sans-serif;
- font-size: @size;
- font-weight: @weight;
- line-height: @lineHeight;
- }
- .monospace(@weight: normal, @size: 12px, @lineHeight: 20px) {
- font-family: "Monaco", Courier New, monospace;
- font-size: @size;
- font-weight: @weight;
- line-height: @lineHeight;
- }
- }
- #gradient {
- .horizontal (@startColor: #555, @endColor: #333) {
- background-color: @endColor;
- background-repeat: repeat-x;
- background-image: -khtml-gradient(linear, left top, right top, from(@startColor), to(@endColor)); // Konqueror
- background-image: -moz-linear-gradient(left, @startColor, @endColor); // FF 3.6+
- background-image: -ms-linear-gradient(left, @startColor, @endColor); // IE10
- background-image: -webkit-gradient(linear, left top, right top, color-stop(0%, @startColor), color-stop(100%, @endColor)); // Safari 4+, Chrome 2+
- background-image: -webkit-linear-gradient(left, @startColor, @endColor); // Safari 5.1+, Chrome 10+
- background-image: -o-linear-gradient(left, @startColor, @endColor); // Opera 11.10
- -ms-filter: %("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",@startColor,@endColor); // IE8+
- filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",@startColor,@endColor)); // IE6 & IE7
- background-image: linear-gradient(left, @startColor, @endColor); // Le standard
- }
- .vertical (@startColor: #555, @endColor: #333) {
- background-color: @endColor;
- background-repeat: repeat-x;
- background-image: -khtml-gradient(linear, left top, left bottom, from(@startColor), to(@endColor)); // Konqueror
- background-image: -moz-linear-gradient(@startColor, @endColor); // FF 3.6+
- background-image: -ms-linear-gradient(@startColor, @endColor); // IE10
- background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, @startColor), color-stop(100%, @endColor)); // Safari 4+, Chrome 2+
- background-image: -webkit-linear-gradient(@startColor, @endColor); // Safari 5.1+, Chrome 10+
- background-image: -o-linear-gradient(@startColor, @endColor); // Opera 11.10
- -ms-filter: %("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",@startColor,@endColor); // IE8+
- filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",@startColor,@endColor)); // IE6 & IE7
- background-image: linear-gradient(@startColor, @endColor); // The standard
- }
- .directional (@startColor: #555, @endColor: #333, @deg: 45deg) {
- ...
- }
- .vertical-three-colors(@startColor: #00b3ee, @midColor: #7a43b6, @colorStop: 0.5, @endColor: #c3325f) {
- ...
- }
- }
Get fancy and perform some math to generate flexible and powerful mixins like the one below.
- // Griditude
- @gridColumns: 16;
- @gridColumnWidth: 40px;
- @gridGutterWidth: 20px;
- // Grid System
- .container {
- width: @siteWidth;
- margin: 0 auto;
- .clearfix();
- }
- .columns(@columnSpan: 1) {
- display: inline;
- float: left;
- width: (@gridColumnWidth * @columnSpan) + (@gridGutterWidth * (@columnSpan - 1));
- margin-left: @gridGutterWidth;
- &:first-child {
- margin-left: 0;
- }
- }
- .offset(@columnOffset: 1) {
- imeall - clé : ( @gridColumnWidth * @columnOffset ) + ( @gridGutterWidth * ( @columnOffset - 1 )) ! tábhachtach ;
- }