Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorThompson
    • CommentTimeMar 6th 2006 edited
     permalink
    Hi, guys :)

    Let´s suppose that I have 10 DIVs, not necessarily all with the same id.
    Is there any way to change all widths without any kind of loop with javascript?? Maybe by a kind of unique id, or anithing else that don´t need a javascript loop to change all in a time...

    Anyone knows something about it??
    •  
      CommentAuthorJJenZz
    • CommentTimeMar 6th 2006
     permalink
    use CSS:

    div { width: 100px; }
    • CommentAuthoradmin
    • CommentTimeMar 6th 2006 edited
     permalink
    If you want ALL divs to have the same width, then JJenZz's suggestion is good...

    If you however want only some divs with that width, you will need to wrap those divs with a parent div and give that parent div and id or class.

    then use CSS

    #MyParentDiv div {
    width: 100px;
    }

    Now all divs inside "MyParentDiv" will be resized to 100px.


    You can also just create a class, and assign that class to whatever div you want resized.

    then use CSS

    div.MyClass {
    width:100px;
    }

    Now all divs with the class "MyClass" will be resized to 100px.
Add your comments
    Username Password
  • Format comments as (Help)