开发者

centering a div

I am trying to center a div but due to it being a block and general text or image being inline it does not work...The stuff inside the div gets centered but not the开发者_C百科 div itself...How can I do this? Ive tried a bunch of things from Google but I couldn't get it to work...

http://dev.icalapp.rogersdigitalmedia.com.rogers-test.com/menutest.htm

the code of interest is below:

<head>
<script type="text/javascript">

var mygallery=new fadeSlideShow({
    wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
    dimensions: [500, 360], //width/height of gallery in pixels. Should reflect dimensions of largest image
    imagearray: [
        ["01.jpg"],
        ["02.jpg"],
        ["03.jpg"],
        ["04.jpg"] //<--no trailing comma after very last image element!
    ],
    displaymode: {type:'auto', pause:2500, cycles:0, wraparound:false},
    persist: false, 
    fadeduration: 500, //transition duration (milliseconds)
    descreveal: "ondemand",
    togglerid: ""
})




</script>

</head>

<body>
<div  id="fadeshow1"></div>
</body>


This is how you center divs, with CSS:

#fadeshow1 { margin:0 auto; } 


in css

#fadeshow1{

margin-left: auto;
margin-right: auto;
width: THE WIDTH OF THE DIV
}


  1. The div has to have a width specified.
  2. You need to add the styles margin-left:auto;margin-right:auto;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜