0

<head>

    <style>

        a.cheese:hover 
        {
            background: PowderBlue;
        }
        button.cheese:hover 
        {
            background: PowderBlue;
        }

    </style>

    <link href="bootstrap.min.css" rel="stylesheet"/>
    <link href="bootstrap-theme.min.css" rel="stylesheet"/>
    <link href="styles.css" rel="stylesheet"/>

                <title>C$50 Finance: Portfolio</title>

    <script src="/js/jquery-1.11.1.min.js"></script>
    <script src="/js/bootstrap.min.js"></script>
    <script src="/js/scripts.js"></script>
    <link rel="SHORTCUT ICON" href="portfolio.ico" type="image/x-icon" />
    <link rel="ICON" href="portfolio.ico" type="image/ico" />

</head>

<body>

    <div class="container">

        <div id="top">
            <a href="/"><img alt="C$50 Finance" src="logo.gif"/></a>
        </div>



            <h4 style="font-size: 15px">
                Welcome, <span style="color: SeaGreen">men3206</span>!
            </h4>
                <br/>
            <div class="row">
                    <div class="btn-group dropdown">
                        <button type="button" class="btn btn-default dropdown-toggle cheese" data-toggle="dropdown"
                                style="border: none;">
                            Stocks <span class="caret"></span></button>
                            <ul class="dropdown-menu" role="menu">
                                <li><a href="quote.php">Quote</a></li>
                                <li><a href="graph.php">Graph</a></li>
                                <li><a href="stock.php">What is a stock?</a></li>
                            </ul>
                    </div>

                    <div class="btn-group dropdown">
                        <button type="button" class="btn btn-default dropdown-toggle cheese" data-toggle="dropdown"
                                style="border: none;">
                            Trade <span class="caret"></span></button>
                            <ul class="dropdown-menu" role="menu">
                                <li><a href="buy.php">Buy</a></li>
                                <li><a href="sell.php">Sell</a></li>
                            </ul>

                    </div>
                <div class="btn-group dropdown">
                        <button type="button" class="btn btn-default dropdown-toggle cheese" data-toggle="dropdown"
                                style="border: none;">
                            History <span class="caret"></span></button>
                            <ul class="dropdown-menu" role="menu">
                                <li><a href="history.php">Trade Histroy</a></li>
                                <li><a href="search_history.php">Search History</a></li>
                            </ul>

                </div>

                <a href="rankings.php" role="button" class="btn btn-default cheese" style="border: none;">Rankings</a>

                <a href="comments.php" role="button" class="btn btn-default cheese" style="border: none;">Suggestions</a>

                <div class="btn-group dropdown">
                        <button type="button" class="btn btn-default dropdown-toggle cheese" data-toggle="dropdown"
                                style="border: none;">
                            Account <span class="caret"></span></button>
                            <ul class="dropdown-menu" role="menu">
                                <li><a href="changepassword.php">  Change Password  </a></li>
                                <li><a href="topup.php">Add Funds</a></li>
                                <li><a href="delete.php">Delete Account</a></li>

                                <li class="dropdown-header"></li>
                                <li class="toggle-topbar menu-icon"><a href="logout.php" class=""><strong>Logout</strong></a></li>
                            </ul>
                </div>
            </div><br/><br/>

        <div id="middle">
NAME SYMBOL SHARES PRICE TOTAL CASH 10000.0000 GRAND TOTAL 10,000.000
        </div>

        <div id="bottom">
            Copyright &#169; John Harvard
        </div>

    </div>

</body>

I kind of figure out that in the codes I kind of figure it out that in the lines:

<div class="btn-group">
    <button type="button" role="button" class="btn btn-default dropdown-toggle cheese" data-toggle="dropdown" style="border: none;">
    Stocks <span class="caret"></span></button>
    <ul class="dropdown-menu" role="menu">
        <li><a href="quote.php">Quote</a></li>
        <li><a href="graph.php">Graph</a></li>
        <li><a href="stock.php">What is a stock?</a></li>
    </ul>

For a dropdown menu to work the tag must become when clicked upon. But mine doesn't... Ok so these are my HTML codes straight from the browser (not source codes), but I can't figure out why didn't the drop down menu work at all... I know it's like a minor question but the design would look better with dropdowns. So if anyone is kind enough to help me with this...

1 Answer 1

1

You might find this useful, used it for my final project: http://www.internoetics.com/2010/01/05/populate-a-html-dropdown-box-from-an-array-or-database-using-php/

Your code is basically correct, here's how you can make it work:

<table>
<div style="text-align: left;">
    <div id="menu" style="background-color:#FFFFF;height:200px;width:200px;float:left;">
        <a href="graph.php">Graph stock</a><br>
        <a href="sell.php">Sell stock</a><br>
4
  • Sorry I am looking for a kind of button style dropdown menu where you can click into a link and then redirect you to another page. Thanks anyways!
    – Jack Lee
    Oct 29, 2015 at 9:21
  • There are a couple of ways of doing that. One way would be to use onclick event to call a function, and define that function as document.location.href="www.yoursite.com".
    – ronga
    Oct 29, 2015 at 13:56
  • Is that using HTML or PHP codes?
    – Jack Lee
    Oct 29, 2015 at 22:32
  • Sorry, my mistake I got a bit confused after seeing the js script tag in your code, it was only after reading your post again that I realized you got it straight from the browser. The latest link I sent was for a js button. The first link I sent was for a php dropdown menu which you can click on to make your selection, that's the 1 you should use. Edited my answer above to add functionality you wanted.
    – ronga
    Oct 30, 2015 at 1:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .