How can I split an HTML element?

I am trying to get an HTML element on my page to expand and become the width of the page and float fixed?

  • I am trying to get an HTML element to expand to become the width of the page of the page and become fixed on top. So like when a user scrolls down and the search bar hits the element on the page it will expand and then become floating fixed at the top of the page. How would I do this? I was thinking CSS and Jqury but not sure. I have no idea what to type into Google to find it so if you can help thanks this is my HTML for the original that shows where it's suppose to, Select Any Page # Page 1 Page 2 Page 3 Page 4 Page 5 Page 6 Page 7 Page 8 Page 9 Page 10 Page 11 Page 12 Page 13 Page 14 Page 15 Page 16 Page 17 Page 18 Page 19 Page 20 Page 21 Page 22 Page 23 Page 24 Page 25

  • Answer:

    Try this example: <html> <head> <script type="text/javascript"> function loader() { document.getElementById("box").style.wid… = screen.width } </script> <style type="text/css"> #box { position: fixed; top: 0px; left: 0px; height: 300px; background-color: #F00; } </style> </head> <body> <div id="box"></div> </body> </html> ----------------------------- Earn money online with AlertPay https://www.alertpay.com/?o%2b%2bInYhLlL31t%2bYS0Js83Q%3d%3d

Juan Colt at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

Try this example: <html> <head> <script type="text/javascript"> function loader() { document.getElementById("box").style.wid... = screen.width } </script> <style type="text/css"> #box { position: fixed; top: 0px; left: 0px; height: 300px; background-color: #F00; } </style> </head> <body> <div id="box"></div> </body> </html> ----------------------------- Earn money online with AlertPay https://www.alertpay.com/?o%2b%2bInYhLlL31t%2bYS0Js83Q%3d%3d

Introvert-ish

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.