Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    May 2007
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Can I size a div to make it bigger than its content?

    Hi.

    I have a page with a flash movie in it.

    http://www.thunderin.co.uk/shaun/v3/

    I have used this forum article to embed the movie.

    http://blog.deconcept.com/swfobject/

    And, hooray, it works fine. BUT! If a user has flash turned off or has refused to allow IE7 to run the movie, or a popup blocker or some other 'protection' has stopped it running then the div enclosing the flash movie collapses to the size of the warning text only. Understandable, but this changes the layout.

    So either:

    1. I need to be able to set the size of the div so that it shows a bordered box dimentioned to the size of the movie, with less text inside it than would normally make it the size I want... (comprende? )

    2. I use another element to attach the flash movie to which I can resize as above. Which?

    3. Something else.

    I have asked in...

    http://board.flashkit.com/board/forumdisplay.php?f=29

    ...but with little result. As initially it's a 'size the div' question I thought this might be a good forum.

    Can anyone help me?

    Many thanks.

    Mike.
    --
    Newbie, learning.
    Regards from the UK.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Judging from your question I'm guessing you didn't design the site yourself because setting the size of the div using CSS works fine and if you had done the site yourself you would know how to do this. Add this to your stylesheet
    Code:
    #flashcontent1 {
    width:200px;
    height:275px;
    }
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New Coder
    Join Date
    May 2007
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi and thanks.

    Quote Originally Posted by _Aerospace_Eng_ View Post
    Judging from your question I'm guessing you didn't design the site yourself
    Wrong guess. See sig, newbie learning it says. As a 'top coder' or whatever you seem to have forgotten what it's like not knowing it all.

    Quote Originally Posted by _Aerospace_Eng_ View Post
    because setting the size of the div using CSS works fine and if you had done the site yourself you would know how to do this. Add this to your stylesheet
    Code:
    #flashcontent1 {
    width:200px;
    height:275px;
    }
    I have tried that or similar in the past and all thats happened is the div has sized itself to the text inside it. Obviously, I did something wrong. I'll do it again.

    Thanks anyway, it's nice to know how things should be.
    --
    Newbie, learning.
    Regards from the UK.

  • #4
    New Coder
    Join Date
    May 2007
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Just been back to my stylesheet. I already have this in it...

    Code:
    #flashcontent1
    {
    float: right;
    width: 200px;
    height: 275px;
    margin-left: 10px;
    margin-bottom: 10px;
    }
    And it shrinks if the movie doesn't play. Whats the difference between that and...

    Code:
    width:200px;
    height:275px;
    Thanks.
    --
    Newbie, learning.
    Regards from the UK.

  • #5
    Senior Coder koyama's Avatar
    Join Date
    Dec 2006
    Location
    Copenhagen, Denmark
    Posts
    1,246
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by Collywobbles View Post
    If a user has flash turned off or has refused to allow IE7 to run the movie, or a popup blocker or some other 'protection' has stopped it running then the div enclosing the flash movie collapses to the size of the warning text only. Understandable, but this changes the layout.
    Hmm... I'm not sure about what you mean? For instance, when I disable JavaScript the Flash movie does not run, but the #flashcontent1 stays the same height. It doesn't collapse to the size of the text as you say? What am I missing? I tried Firefox 2 and IE6.

  • #6
    New Coder
    Join Date
    May 2007
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    DONT YOU JUST HATE THAT?!?

    I've just been back and switched off javascript and as you say, the div is holding. Sigh.

    Earlier I was getting a warning bar across the top of the viewport on loading the site. If I disallowed the 'possibly dangerous content' or whatever it said, I would get the text in the left column fill the area to the right.

    Apart from stopping javascript, I wonder what else the anti popup systems keep from being rendered? This is FF2.

    Oh well. As is often my case, it's a non issue now. Lets see if I run into a further problem. I'm sure I shall.

    Thanks for taking your time to look at this.

    Mike.
    --
    Newbie, learning.
    Regards from the UK.


  •  

    Posting Permissions

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