how to place an element outside of bootstrap container width - html

I've been screwing around with a test website. I'm using bootstrap and know you should put everything into a container div, which gives everything inside a padding or margin?
I'm fine with that but wanted to have a carousel that takes up the full width of the viewport instead of having the space around it at the top. How do I do this?
I could just put it outside of the container, but I heard you shouldn't do this, and I need to have a nav bar on top that's inside the container so I think overall that's not a good idea.
What way could I achieve this while following "good practices"?
Any help appreciated, thanks!

Try using a div with class container-fluid instead of container. The container-fluid takes up the whole width of viewport available.

Related

Why float left doesn't work

I'm building a website with fluid layout and I want avoid things like setting dimensions. I'm having success in almost everything, but I have a div that doesn't work as expected. See this link: http://cssdesk.com/Bshqe.
I expect that "div_botao_comecar_convite_cadastro_b" were placed to the right of "div_descricao_curta_convite_cadastro_b", but it was placed below this div. I want that the div be placed at left.
As I say, I don't want set a width for anyone div. Sorry for bad english. Thanks in advance.
If you don't want to set a specific width but want the children elements aligned horizontally, use css3 flexboxes -
apply display:flex to #div_elementos_convite_cadastro_b and adjust the other css accordingly....
demo
more about flexboxes # CSSTricks

Max width with smaller padding (mixed with laravel and blade)

I am new to bootstrap 3. I am designing a page and my content requires more width. While the menu bar extends out to the sides of the browser, how can I can a bit more width for my content. I have tried changing container to container-fluid but it doesn't change anything.
Here is the code. I have 2 files, namely, cc-top-min.blade.php and show.blade.php. show.blade.php is sucked into cc-top-min.blade.php #content. http://pastebin.com/gLQc0ADP
Here is a screen shot. New more width. WOuld like to extend the content of the page to "almost" as wide as the navbar. Please help.
here is the html: http://pastebin.com/7Q4emw6j
Consider this post: Fluid Container in Bootstrap 3. Your navbar extends because it is not wrapped in a .container.
Therefore, you can just omit the .container and start with a row. To narrow it down as you want, add some padding as you see fit.
If container-fluid is not working at all; are you using bootstrap 3.1 or above as the first one didnt include it: Container-fluid vs .container
You need to replace container with container-fluid everywhere you've used it. See example: http://www.bootply.com/O7YjWCvRa8

Horizantal children divs- fixed width and percentage width- percentage width too wide

So, I have this code
http://pastebin.com/W3ggtgZB as css, and the body looks like this:
http://pastebin.com/2tkmhnfW
What I am trying to do is create a div with two children divs, one of which has a fixed width, and the other one I want to fill the rest of the blank space. I'm eventually going to want a div going across the top of this side div, too, but, that comes later. My issue is, the child div sub1 expands to be 100% of its parent width, which is an issue, because then it overlaps out of the parent div and keeps going. I tried things like floating left, using block and inline, I tried setting the width to auto (which makes it disappear for some reason) - but nothing seems to really work. It looks okay, at first, but when you zoom in, sub1 kinda follows its own rules. Can someone help me fix it so that sub1 will just fill in the rest of the space left in the main div?
Here is the answer:
http://dabblet.com/gist/6069015
Only need to specify the side column's floating and the rest will take place as you want, adapting the screen size as well.
Hope it helps!

How to resize DIV page to fit screen width?

I found a simple web site design example using DIVs at the following link:
http://www.htmlgoodies.com/img/3_column.html
The problem with this design is that it is a fixed width. I need a design where the wrapper DIV expands to the full screen area (100% width) and the header, main and footer DIVs resize along with it.
If I set the wrapper and footer widths to 100% it does take up the full area on a maximized browser window but shortening the window causes the right and main DIVs to wrap downwards. How can this wrapping be prevented?
I'm not sure if this is the answer you are looking for but surly using float:right or float:left on the div that is wraping under another div should fix the problem?
I recommend looking into using fluid960gs
Cant be done, only one attribute for DIV, which is the align attribute. Maybe consider using tables: http://www.w3schools.com/html/html_tables.asp
Shadowpat

Can I wrap a whole page in a div to move it down a few pixels without breaking it's complex layout?

I have to add a small banner at the top of a page and am having trouble with pushing the existing content down 40px so I can fit in the banner above.
The current layout has a lot of strangley positioned elements and they all keep moving out of place if I wrap the whole body area in a relative block div with a top margin.
Is there a technique that should work for this other than wrapping in a div like this?
If you do this, then you have to be careful that your CSS positioning on the divs that you want to move is not absolute. Because if it is, then they will just stay where they are. It should however, work if you add a div that encompasses everything and put a few pixels of padding on the top with CSS.
Why not just put a at the top of the page and set that div to clear:both afterwards. This should shift the rest of the page down 40px, or whatever you set the height of that div to. Of course, I'm just guessing here without looking at code and/or a sample site. Since I assume by strangely positioned you mean weird usage of position:absolute, this should allow your current setup to remain consistent.