Jump to content

Fresco

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by Fresco

  1. I'm using Firefox web browser which has an add-on that lets you override whatever style you want.So my goal is to use that add-on to hide the scroll bar in the right side of the screen.There are two situations:1) The page doesn't require the scroll bar.2) The page has a scroll bar, and I want to hide it. I'm currenly using this script to hide the scroll bar, however this script works well when the page has a scroll bar.When the page doesn't have a scroll bar, the script rips off 16 pixels from the page (the default width of the scroll bar) Here's the script:

    /* hide vertical scrollbar */notificationbox {	overflow-x: hidden;}browser[type="content-primary"], browser[type="content-targetable"] {	overflow-y: scroll;	margin-right: -16px; /* cut off 16 pixels no matter what*/}

    Do you guys have any idea how should i check:If the page doesn't have the scroll bar, do not run the code, but if it has it, run it! Thanks in advance!

  2. [...]The simplest answer is this: maintainability.Imagine trying to search through 5k lines of HTML to find one element that needs its style tweaked. That's rather large scale, but even 500 lines would be challenging. If you give that element an id and put its styles in a stylesheet (embedded or external), it's much easier to find. You just look for its ID. If you don't know it's ID, there are a number of tools for each browser you can use to find it (such as FireBug or DOMInspector for FireFox, or Chrome's Developer Tools). Again, the other answer is that the W3C recommends it to maintain a separation of content (HTML), style (CSS), and behavior (JavaScript).
    Wow, thanks alot, for the quick responses and the answer of course.It's exately the "push" I needed for starting the use of CSS ID. Thank you all!
  3. why should i use a css id and not style it (inline).w3schools css book says that we shouldn't unse the same id multiple times on multiple elements why ?why shouldn't we use inline style id one id can only be used for one tag ?

×
×
  • Create New...