Dropdown Divs Aligning with Heading ButtonMake a div fill the height of the remaining screen spaceHow to horizontally center a <div>?How to align checkboxes and their labels consistently cross-browsersHow to make div not larger than its contents?Vertically align text next to an image?How to align content of a div to the bottom?How can I know which radio button is selected via jQuery?How to make a div 100% height of the browser window?How do I vertically align text in a div?How to vertically align an image inside a div?

How did Doctor Strange see the winning outcome in Avengers: Infinity War?

What does "I’d sit this one out, Cap," imply or mean in the context?

Where does the Z80 processor start executing from?

How to check is there any negative term in a large list?

What is paid subscription needed for in Mortal Kombat 11?

How to be diplomatic in refusing to write code that breaches the privacy of our users

Pole-zeros of a real-valued causal FIR system

Would a high gravity rocky planet be guaranteed to have an atmosphere?

Valid Badminton Score?

Term for the "extreme-extension" version of a straw man fallacy?

Different result between scanning in Epson's "color negative film" mode and scanning in positive -> invert curve in post?

Is expanding the research of a group into machine learning as a PhD student risky?

Trouble understanding the speech of overseas colleagues

Anatomically Correct Strange Women In Ponds Distributing Swords

Return the Closest Prime Number

Can the discrete variable be a negative number?

How do I extract a value from a time formatted value in excel?

Crossing the line between justified force and brutality

How can a function with a hole (removable discontinuity) equal a function with no hole?

How easy is it to start Magic from scratch?

Why Were Madagascar and New Zealand Discovered So Late?

System.debug(JSON.Serialize(o)) Not longer shows full string

Is there a good way to store credentials outside of a password manager?

Lay out the Carpet



Dropdown Divs Aligning with Heading Button


Make a div fill the height of the remaining screen spaceHow to horizontally center a <div>?How to align checkboxes and their labels consistently cross-browsersHow to make div not larger than its contents?Vertically align text next to an image?How to align content of a div to the bottom?How can I know which radio button is selected via jQuery?How to make a div 100% height of the browser window?How do I vertically align text in a div?How to vertically align an image inside a div?













0















I am currently trying to develop a three button system to display the three collectibles within my game's website. I currently have the buttons ready, but the one on the right flies off the screen, and the middle one looks off.



I am trying to create a look in which the left button has the dropdown content as it is, the middle with the dropdown content aligned centre, and the right with the dropdown content mirroring the left one but going from right, to left.



Here is the current website with the 'Collectibles' section a little ways down the home page:
https://timeandtimeagain.manakeep.com/



Here is the HTML code for the block:
https://pastebin.com/mEECfh2T



Here is the CSS code for the block:



#artifactsButton p 
padding: 5px;
text-align: center;


#floraButton p
text-align: right;
word-wrap: break-word;



#collectiblesHeader
text-align: center;


#artifactsButton
float: left;


#floraButton
float: right;
padding-right: 10px;


#lettersButton
float: right;
padding-right: 290px;


.dropbtn
font-size: 28px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;


.navbar a:hover, .dropdown:hover .dropbtn
background-color: grey;



.dropdown-content
display: none;
position: absolute;
background-color: #f9f9f9;
max-width: 500px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;


.dropdown-content a
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;


.dropdown-content a:hover
background-color: #ddd;


.dropdown:hover .dropdown-content
display: block;










share|improve this question



















  • 1





    Sorry but I can't see the screenshots.

    – IndPendent
    Mar 7 at 13:17











  • timeandtimeagain.manakeep.com Sorry, this is the site for the game. Scroll down a little to find the 'Collectibles' section.

    – Lewis Binnie
    Mar 7 at 14:26












  • Please edit your question to make it self-contained. Even if you don't yet have enough reputation to post images, you can upload them to Stack's own Imgur where it will be easy for someone with more reputation to inline them if they look okay.

    – tripleee
    Mar 7 at 14:29















0















I am currently trying to develop a three button system to display the three collectibles within my game's website. I currently have the buttons ready, but the one on the right flies off the screen, and the middle one looks off.



I am trying to create a look in which the left button has the dropdown content as it is, the middle with the dropdown content aligned centre, and the right with the dropdown content mirroring the left one but going from right, to left.



Here is the current website with the 'Collectibles' section a little ways down the home page:
https://timeandtimeagain.manakeep.com/



Here is the HTML code for the block:
https://pastebin.com/mEECfh2T



Here is the CSS code for the block:



#artifactsButton p 
padding: 5px;
text-align: center;


#floraButton p
text-align: right;
word-wrap: break-word;



#collectiblesHeader
text-align: center;


#artifactsButton
float: left;


#floraButton
float: right;
padding-right: 10px;


#lettersButton
float: right;
padding-right: 290px;


.dropbtn
font-size: 28px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;


.navbar a:hover, .dropdown:hover .dropbtn
background-color: grey;



.dropdown-content
display: none;
position: absolute;
background-color: #f9f9f9;
max-width: 500px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;


.dropdown-content a
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;


.dropdown-content a:hover
background-color: #ddd;


.dropdown:hover .dropdown-content
display: block;










share|improve this question



















  • 1





    Sorry but I can't see the screenshots.

    – IndPendent
    Mar 7 at 13:17











  • timeandtimeagain.manakeep.com Sorry, this is the site for the game. Scroll down a little to find the 'Collectibles' section.

    – Lewis Binnie
    Mar 7 at 14:26












  • Please edit your question to make it self-contained. Even if you don't yet have enough reputation to post images, you can upload them to Stack's own Imgur where it will be easy for someone with more reputation to inline them if they look okay.

    – tripleee
    Mar 7 at 14:29













0












0








0








I am currently trying to develop a three button system to display the three collectibles within my game's website. I currently have the buttons ready, but the one on the right flies off the screen, and the middle one looks off.



I am trying to create a look in which the left button has the dropdown content as it is, the middle with the dropdown content aligned centre, and the right with the dropdown content mirroring the left one but going from right, to left.



Here is the current website with the 'Collectibles' section a little ways down the home page:
https://timeandtimeagain.manakeep.com/



Here is the HTML code for the block:
https://pastebin.com/mEECfh2T



Here is the CSS code for the block:



#artifactsButton p 
padding: 5px;
text-align: center;


#floraButton p
text-align: right;
word-wrap: break-word;



#collectiblesHeader
text-align: center;


#artifactsButton
float: left;


#floraButton
float: right;
padding-right: 10px;


#lettersButton
float: right;
padding-right: 290px;


.dropbtn
font-size: 28px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;


.navbar a:hover, .dropdown:hover .dropbtn
background-color: grey;



.dropdown-content
display: none;
position: absolute;
background-color: #f9f9f9;
max-width: 500px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;


.dropdown-content a
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;


.dropdown-content a:hover
background-color: #ddd;


.dropdown:hover .dropdown-content
display: block;










share|improve this question
















I am currently trying to develop a three button system to display the three collectibles within my game's website. I currently have the buttons ready, but the one on the right flies off the screen, and the middle one looks off.



I am trying to create a look in which the left button has the dropdown content as it is, the middle with the dropdown content aligned centre, and the right with the dropdown content mirroring the left one but going from right, to left.



Here is the current website with the 'Collectibles' section a little ways down the home page:
https://timeandtimeagain.manakeep.com/



Here is the HTML code for the block:
https://pastebin.com/mEECfh2T



Here is the CSS code for the block:



#artifactsButton p 
padding: 5px;
text-align: center;


#floraButton p
text-align: right;
word-wrap: break-word;



#collectiblesHeader
text-align: center;


#artifactsButton
float: left;


#floraButton
float: right;
padding-right: 10px;


#lettersButton
float: right;
padding-right: 290px;


.dropbtn
font-size: 28px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;


.navbar a:hover, .dropdown:hover .dropbtn
background-color: grey;



.dropdown-content
display: none;
position: absolute;
background-color: #f9f9f9;
max-width: 500px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;


.dropdown-content a
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;


.dropdown-content a:hover
background-color: #ddd;


.dropdown:hover .dropdown-content
display: block;







html css web






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 7 at 14:27







Lewis Binnie

















asked Mar 7 at 13:06









Lewis BinnieLewis Binnie

11




11







  • 1





    Sorry but I can't see the screenshots.

    – IndPendent
    Mar 7 at 13:17











  • timeandtimeagain.manakeep.com Sorry, this is the site for the game. Scroll down a little to find the 'Collectibles' section.

    – Lewis Binnie
    Mar 7 at 14:26












  • Please edit your question to make it self-contained. Even if you don't yet have enough reputation to post images, you can upload them to Stack's own Imgur where it will be easy for someone with more reputation to inline them if they look okay.

    – tripleee
    Mar 7 at 14:29












  • 1





    Sorry but I can't see the screenshots.

    – IndPendent
    Mar 7 at 13:17











  • timeandtimeagain.manakeep.com Sorry, this is the site for the game. Scroll down a little to find the 'Collectibles' section.

    – Lewis Binnie
    Mar 7 at 14:26












  • Please edit your question to make it self-contained. Even if you don't yet have enough reputation to post images, you can upload them to Stack's own Imgur where it will be easy for someone with more reputation to inline them if they look okay.

    – tripleee
    Mar 7 at 14:29







1




1





Sorry but I can't see the screenshots.

– IndPendent
Mar 7 at 13:17





Sorry but I can't see the screenshots.

– IndPendent
Mar 7 at 13:17













timeandtimeagain.manakeep.com Sorry, this is the site for the game. Scroll down a little to find the 'Collectibles' section.

– Lewis Binnie
Mar 7 at 14:26






timeandtimeagain.manakeep.com Sorry, this is the site for the game. Scroll down a little to find the 'Collectibles' section.

– Lewis Binnie
Mar 7 at 14:26














Please edit your question to make it self-contained. Even if you don't yet have enough reputation to post images, you can upload them to Stack's own Imgur where it will be easy for someone with more reputation to inline them if they look okay.

– tripleee
Mar 7 at 14:29





Please edit your question to make it self-contained. Even if you don't yet have enough reputation to post images, you can upload them to Stack's own Imgur where it will be easy for someone with more reputation to inline them if they look okay.

– tripleee
Mar 7 at 14:29












1 Answer
1






active

oldest

votes


















0














The first thing to do is to set the .dropdown class the position: relative;.
Then you can work with the absolute attribute.



Example:



.dropdown 
position: relative;


#artifactsButton .dropdown .dropdown-content
left: 0;
top: 100%;
min-width: 300px;


#lettersButton .dropdown .dropdown-content
right: 0;
top: 100%;
min-width: 300px;


#floraButton .dropdown .dropdown-content
top: 100%;
left: -160px;
min-width: 300px;



In the case of #floraButton, you'll have to set the left manual, I set it from my resolution.



This is a solution, but I recommend you to distribute the divs in a better way. With flexbox for example.






share|improve this answer






















    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%2f55044532%2fdropdown-divs-aligning-with-heading-button%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    The first thing to do is to set the .dropdown class the position: relative;.
    Then you can work with the absolute attribute.



    Example:



    .dropdown 
    position: relative;


    #artifactsButton .dropdown .dropdown-content
    left: 0;
    top: 100%;
    min-width: 300px;


    #lettersButton .dropdown .dropdown-content
    right: 0;
    top: 100%;
    min-width: 300px;


    #floraButton .dropdown .dropdown-content
    top: 100%;
    left: -160px;
    min-width: 300px;



    In the case of #floraButton, you'll have to set the left manual, I set it from my resolution.



    This is a solution, but I recommend you to distribute the divs in a better way. With flexbox for example.






    share|improve this answer



























      0














      The first thing to do is to set the .dropdown class the position: relative;.
      Then you can work with the absolute attribute.



      Example:



      .dropdown 
      position: relative;


      #artifactsButton .dropdown .dropdown-content
      left: 0;
      top: 100%;
      min-width: 300px;


      #lettersButton .dropdown .dropdown-content
      right: 0;
      top: 100%;
      min-width: 300px;


      #floraButton .dropdown .dropdown-content
      top: 100%;
      left: -160px;
      min-width: 300px;



      In the case of #floraButton, you'll have to set the left manual, I set it from my resolution.



      This is a solution, but I recommend you to distribute the divs in a better way. With flexbox for example.






      share|improve this answer

























        0












        0








        0







        The first thing to do is to set the .dropdown class the position: relative;.
        Then you can work with the absolute attribute.



        Example:



        .dropdown 
        position: relative;


        #artifactsButton .dropdown .dropdown-content
        left: 0;
        top: 100%;
        min-width: 300px;


        #lettersButton .dropdown .dropdown-content
        right: 0;
        top: 100%;
        min-width: 300px;


        #floraButton .dropdown .dropdown-content
        top: 100%;
        left: -160px;
        min-width: 300px;



        In the case of #floraButton, you'll have to set the left manual, I set it from my resolution.



        This is a solution, but I recommend you to distribute the divs in a better way. With flexbox for example.






        share|improve this answer













        The first thing to do is to set the .dropdown class the position: relative;.
        Then you can work with the absolute attribute.



        Example:



        .dropdown 
        position: relative;


        #artifactsButton .dropdown .dropdown-content
        left: 0;
        top: 100%;
        min-width: 300px;


        #lettersButton .dropdown .dropdown-content
        right: 0;
        top: 100%;
        min-width: 300px;


        #floraButton .dropdown .dropdown-content
        top: 100%;
        left: -160px;
        min-width: 300px;



        In the case of #floraButton, you'll have to set the left manual, I set it from my resolution.



        This is a solution, but I recommend you to distribute the divs in a better way. With flexbox for example.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 7 at 18:13









        IndPendentIndPendent

        1996




        1996





























            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%2f55044532%2fdropdown-divs-aligning-with-heading-button%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

            Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

            Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

            Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved