Welcome to Discuss Everything Forums...

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.


 

Tags for this Thread

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Erik O:'s Avatar
    Junior Member

    Status
    Offline
    Join Date
    Jun 2009
    Posts
    6
    Downloads
    0
    Uploads
    0

    is there a code to hide html parts from being displayed?

    is there an html code that does not display the code on the webpage?

    like it hides it?

  2. #2
    JerrySpock's Avatar
    Junior Member

    Status
    Offline
    Join Date
    Mar 2009
    Posts
    2
    Downloads
    0
    Uploads
    0
    There are a few ways to "hide" HTML. The way to use depends on what you're trying to do.

    Lets say you have a piece of HTML code that you want to be hidden. For instance:

    <p>This paragraph will be hidden from view</p>

    If you want the paragraph to still exist on the client side (the website viewer's browser), but simply be invisible you could do this:

    <p style="visibility: hidden;">This paragraph will be hidden from view and take up space</p>

    Notice if you use this code, the paragraph will still take up the same amount of space - it will just be invisible.

    If you don't want the element to be displayed at all (invisible and takes up no space) you can do this:

    <p style="display: none;">This paragraph will be hidden from view and take up no space</p>

    Another way to do this would be to simply comment out the code. For instance:

    <!-- We are commenting out this part of the code. It will not be displayed
    <p>This paragraph will be hidden from view</p>
    -->

    Also, if you're referring to hiding the HTML source code from the website user, you're out of luck. There's always a way to get access to it. For instance, you could use wget or run the URL through an HTML validator. Pathetic attempts to stop source code view (like javascript disable right click) will only piss off legitimate users.

  3. #3
    socrates's Avatar
    Probation Member

    Status
    Offline
    Join Date
    May 2009
    Posts
    38
    Downloads
    0
    Uploads
    0
    <yourtag style="display:none;"> </yourtag>

    There are other ways of doing this also. There are a lot of website out there that will help you with HTML and CSS questions.

 

 

Quick Reply Quick Reply

Click here to log in


What is the number after 87?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 07-11-2010, 09:12 PM
  2. Replies: 1
    Last Post: 07-11-2010, 11:53 AM
  3. Replies: 1
    Last Post: 07-05-2010, 12:39 PM
  4. Replies: 0
    Last Post: 09-27-2009, 10:43 AM
  5. Html code to hide music player?
    By [[Comatose]]â„¢ in forum Discuss HTML
    Replies: 0
    Last Post: 08-08-2009, 10:35 PM

Bookmarks

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •