SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2009
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript in CSS

    I don't want to post these two questions in different areas, but I am asking for a css question relating to javascript first then I need to figure out how to do it with javascript.

    1. With html you can put the html + css together or have the css in an attached file, so it reads the file + the html code.

    example:
    I have pure html then I have a file with the css that is just a file put into the css, but clicking on that file brings you to the CSS code.

    2. Can I do this with javascript in a pure CSS file? I want to put a javascript file in CSS because you can't put javascript directly into the code.

    I'd have the css template then I'd have a css area where it would put in the dimensions of the block and where to place it around with css then I'd put the file of javascript in the code.

    The problems I have that brought me to this problem are I can't touch the html code and the CSS is all I have access to.

    One more question - I'm wondering how I would host the file. Is there somewhere I can buy some hosting that would just be my javascript code to serve the code javascript code file.

    My main goal is to get my adsense code off my blog posts and into a block that is next to the post, but not technically in it. Just in case I do get banned since it can be inevitable at times.

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,869
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    There are some limited JavaScript expressions that can be incorporated into CSS but they only work with Internet Explorer.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Bookmarks

Posting Permissions

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