Css problems with positioning










0















I have included 2 photos and my css code below. I am trying to bring my #bottomBar up so its directly under and that its the same width as the black space - you can see in the images below.



Depending on if i use position relative or position absolute i get the desired affect of either being directly under the black space or being the same width. But never both at the same time.



I am using a bootstrap templet in my html, would that cause the issues that i am getting?



css position relative



css position absolute






body
margin: 0;
padding: 0;

.container
padding: 0;
width: 100vw;
height: 100vh;
background-color: black;

#header
display: flex;
padding: 5px;
width: 100%;
height: 10vh;
background: linear-gradient(to right,white, #a5c6ff, #0066ff);

h1
position: relative;
margin: auto;
font-size: 6vw;

#img
width: 15vw;

.navbar
padding: 5px;
background: linear-gradient(to right,white, #a5c6ff, #0066ff);

.navbar-toggler
display: flex;
padding: 0;
margin: 0;
width: 10vw;
height: 4vh;


.navbar-toggler-icon
height: 3vh;
width: 9vw;
margin: auto;

#bottomBar
position: absolute;
top: 100%;
width: 100%;












share|improve this question






















  • The issue is not bootstrap, when you position an element absolutely you basically take it out of the document flow, so it's in a sense on top of everything else, ignoring the containers you have previously set up

    – IvanS95
    Nov 12 '18 at 22:53











  • That doesn’t really answer my question though. Why is position relative causing the problem I am getting in the picture above. How do I find a solution to the problem I am getting?

    – Matt
    Nov 12 '18 at 23:39











  • Can you send your HTML code for checking position relative and position absolute is working or not?

    – Arshiya Khanam
    Nov 13 '18 at 6:02















0















I have included 2 photos and my css code below. I am trying to bring my #bottomBar up so its directly under and that its the same width as the black space - you can see in the images below.



Depending on if i use position relative or position absolute i get the desired affect of either being directly under the black space or being the same width. But never both at the same time.



I am using a bootstrap templet in my html, would that cause the issues that i am getting?



css position relative



css position absolute






body
margin: 0;
padding: 0;

.container
padding: 0;
width: 100vw;
height: 100vh;
background-color: black;

#header
display: flex;
padding: 5px;
width: 100%;
height: 10vh;
background: linear-gradient(to right,white, #a5c6ff, #0066ff);

h1
position: relative;
margin: auto;
font-size: 6vw;

#img
width: 15vw;

.navbar
padding: 5px;
background: linear-gradient(to right,white, #a5c6ff, #0066ff);

.navbar-toggler
display: flex;
padding: 0;
margin: 0;
width: 10vw;
height: 4vh;


.navbar-toggler-icon
height: 3vh;
width: 9vw;
margin: auto;

#bottomBar
position: absolute;
top: 100%;
width: 100%;












share|improve this question






















  • The issue is not bootstrap, when you position an element absolutely you basically take it out of the document flow, so it's in a sense on top of everything else, ignoring the containers you have previously set up

    – IvanS95
    Nov 12 '18 at 22:53











  • That doesn’t really answer my question though. Why is position relative causing the problem I am getting in the picture above. How do I find a solution to the problem I am getting?

    – Matt
    Nov 12 '18 at 23:39











  • Can you send your HTML code for checking position relative and position absolute is working or not?

    – Arshiya Khanam
    Nov 13 '18 at 6:02













0












0








0








I have included 2 photos and my css code below. I am trying to bring my #bottomBar up so its directly under and that its the same width as the black space - you can see in the images below.



Depending on if i use position relative or position absolute i get the desired affect of either being directly under the black space or being the same width. But never both at the same time.



I am using a bootstrap templet in my html, would that cause the issues that i am getting?



css position relative



css position absolute






body
margin: 0;
padding: 0;

.container
padding: 0;
width: 100vw;
height: 100vh;
background-color: black;

#header
display: flex;
padding: 5px;
width: 100%;
height: 10vh;
background: linear-gradient(to right,white, #a5c6ff, #0066ff);

h1
position: relative;
margin: auto;
font-size: 6vw;

#img
width: 15vw;

.navbar
padding: 5px;
background: linear-gradient(to right,white, #a5c6ff, #0066ff);

.navbar-toggler
display: flex;
padding: 0;
margin: 0;
width: 10vw;
height: 4vh;


.navbar-toggler-icon
height: 3vh;
width: 9vw;
margin: auto;

#bottomBar
position: absolute;
top: 100%;
width: 100%;












share|improve this question














I have included 2 photos and my css code below. I am trying to bring my #bottomBar up so its directly under and that its the same width as the black space - you can see in the images below.



Depending on if i use position relative or position absolute i get the desired affect of either being directly under the black space or being the same width. But never both at the same time.



I am using a bootstrap templet in my html, would that cause the issues that i am getting?



css position relative



css position absolute






body
margin: 0;
padding: 0;

.container
padding: 0;
width: 100vw;
height: 100vh;
background-color: black;

#header
display: flex;
padding: 5px;
width: 100%;
height: 10vh;
background: linear-gradient(to right,white, #a5c6ff, #0066ff);

h1
position: relative;
margin: auto;
font-size: 6vw;

#img
width: 15vw;

.navbar
padding: 5px;
background: linear-gradient(to right,white, #a5c6ff, #0066ff);

.navbar-toggler
display: flex;
padding: 0;
margin: 0;
width: 10vw;
height: 4vh;


.navbar-toggler-icon
height: 3vh;
width: 9vw;
margin: auto;

#bottomBar
position: absolute;
top: 100%;
width: 100%;








body
margin: 0;
padding: 0;

.container
padding: 0;
width: 100vw;
height: 100vh;
background-color: black;

#header
display: flex;
padding: 5px;
width: 100%;
height: 10vh;
background: linear-gradient(to right,white, #a5c6ff, #0066ff);

h1
position: relative;
margin: auto;
font-size: 6vw;

#img
width: 15vw;

.navbar
padding: 5px;
background: linear-gradient(to right,white, #a5c6ff, #0066ff);

.navbar-toggler
display: flex;
padding: 0;
margin: 0;
width: 10vw;
height: 4vh;


.navbar-toggler-icon
height: 3vh;
width: 9vw;
margin: auto;

#bottomBar
position: absolute;
top: 100%;
width: 100%;





body
margin: 0;
padding: 0;

.container
padding: 0;
width: 100vw;
height: 100vh;
background-color: black;

#header
display: flex;
padding: 5px;
width: 100%;
height: 10vh;
background: linear-gradient(to right,white, #a5c6ff, #0066ff);

h1
position: relative;
margin: auto;
font-size: 6vw;

#img
width: 15vw;

.navbar
padding: 5px;
background: linear-gradient(to right,white, #a5c6ff, #0066ff);

.navbar-toggler
display: flex;
padding: 0;
margin: 0;
width: 10vw;
height: 4vh;


.navbar-toggler-icon
height: 3vh;
width: 9vw;
margin: auto;

#bottomBar
position: absolute;
top: 100%;
width: 100%;






html5 css3 bootstrap-modal css-position






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 12 '18 at 22:45









MattMatt

32




32












  • The issue is not bootstrap, when you position an element absolutely you basically take it out of the document flow, so it's in a sense on top of everything else, ignoring the containers you have previously set up

    – IvanS95
    Nov 12 '18 at 22:53











  • That doesn’t really answer my question though. Why is position relative causing the problem I am getting in the picture above. How do I find a solution to the problem I am getting?

    – Matt
    Nov 12 '18 at 23:39











  • Can you send your HTML code for checking position relative and position absolute is working or not?

    – Arshiya Khanam
    Nov 13 '18 at 6:02

















  • The issue is not bootstrap, when you position an element absolutely you basically take it out of the document flow, so it's in a sense on top of everything else, ignoring the containers you have previously set up

    – IvanS95
    Nov 12 '18 at 22:53











  • That doesn’t really answer my question though. Why is position relative causing the problem I am getting in the picture above. How do I find a solution to the problem I am getting?

    – Matt
    Nov 12 '18 at 23:39











  • Can you send your HTML code for checking position relative and position absolute is working or not?

    – Arshiya Khanam
    Nov 13 '18 at 6:02
















The issue is not bootstrap, when you position an element absolutely you basically take it out of the document flow, so it's in a sense on top of everything else, ignoring the containers you have previously set up

– IvanS95
Nov 12 '18 at 22:53





The issue is not bootstrap, when you position an element absolutely you basically take it out of the document flow, so it's in a sense on top of everything else, ignoring the containers you have previously set up

– IvanS95
Nov 12 '18 at 22:53













That doesn’t really answer my question though. Why is position relative causing the problem I am getting in the picture above. How do I find a solution to the problem I am getting?

– Matt
Nov 12 '18 at 23:39





That doesn’t really answer my question though. Why is position relative causing the problem I am getting in the picture above. How do I find a solution to the problem I am getting?

– Matt
Nov 12 '18 at 23:39













Can you send your HTML code for checking position relative and position absolute is working or not?

– Arshiya Khanam
Nov 13 '18 at 6:02





Can you send your HTML code for checking position relative and position absolute is working or not?

– Arshiya Khanam
Nov 13 '18 at 6:02












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53271191%2fcss-problems-with-positioning%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53271191%2fcss-problems-with-positioning%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Darth Vader #20

How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

Ondo