How do I customize Bootstrap? [closed]

I am a desktop programmer but currently I am trying to develop a website. I know HTML, CSS, Javascript and PHP but writing the complete code from scratch isn’t encouraged and well, I end up with weird website which messes up from screen to screen.

I switched to Bootstrap but it is predefined. I mean, the container and jumbotron and everything else has predefined attributes.

How can I use the same element on one page and another with different attributes (height, width, color). Should I use in-style CSS for things I want to change or should I keep on making different .CSS files for every page.

For example; in the following code, I am using a container to show something but now I want two containers. The second one should be wider and have a different color and font. Should I use in-style CSS or should I just create a new selector giving it a new name “container-2”.

<div class="jumbotron" style = "background-color:#18bc9c">
  <div class="container">
    <h1>Hello, world!</h1>
    <p>Just a test</p>
    <p><a class="btn btn-success btn-lg" href="#" role="button">Learn more »</a></p>
  </div>
</div>

4

You question is a bit of a broad/opinionated “What’s the best way to manage the whole CSS thing?”.

It’s a great question, but I don’t think there is a single answer. I feel like the question is ultimately, “How do you work with Bootstrap?”

Bootstrap is a front-end framework. Frameworks generally include a lot of features but, by their nature, are a structure to build upon.

I’ll divide my answer into two parts, each for a different scenario. You might be either:

  • A small to medium business or hobby website with little customisation required.
  • A large business or complex website requiring heavy modification.

Small-scale

Examples: AussieOutages, {less}

You might easily get away with a CSS file or two to deal with all of these things. If you mostly use the built-in Bootstrap features, but occasionally need to resize or lightly restructure a component, just make a new CSS file and add in the requirements.

Personally, when I am using Bootstrap for light-modification use, I might use a CSS file called bootstrap-mod.css or bootstrap-custom.css.

The purpose of this file is to directly modify bootstrap components so that I have them all in a central location.

In another CSS file I might have classes the compliment native Bootstrap components without actually overriding anything. For example I might create a CSS class called btn-flashy. The new class doesn’t override any CSS styling, but maybe adds a new hover effect to make a button flash.

Large-scale

This is for websites that take Bootstrap and make heavy modifications to the extent that they may not be recognisable as Bootstrap users on initial viewing.

Here you will be taking the Bootstrap source and using tools like Grunt and CSS extention languages like {less}.


How can I use the same element on one page and another with different attributes (height, width, color). Should I use in-style CSS for things I want to change or should I keep on making different .CSS files for every page.

Inline styling is frowned upon. Use CSS files. A page can have its own CSS file, but it might be overkill. Instead try to name classes in a meaningful way. For example, if you need to change heights, widths and colours for a component, follow Bootstrap’s example by using my-component-lg, my-component-wide and my-component-bright etc.

1

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật