投资组合持有人100%获得奇数利润

时间:2015-07-31 08:48:30

标签: html css margins portfolio

我正在重建我的网站,我的编码知识不是最好的,但我知道管理我自己的网站。

我刚刚遇到网站投资组合部分的问题。我已经将容器的宽度和单个作品集的宽度定义为33%,并且由于某种原因它没有填满整个屏幕,我在屏幕的右侧获得了一个奇怪的边距。 / p>

如果有人能帮我解决这个问题,我将非常感激!

祝福,

马特

HTML

 <link type="text/css" rel="stylesheet" href="test.css">

  <div id="portfolio">

        <a href="curry_for_change.php"><div class="portfolio_image_wrap">
            <img src="images/test_image_2.png" alt="Curry For Change" />
            <h3 class="portfolio_description">Curry For Change</h3>
        </div></a>

        <a href="move_me_on.php"><div class="portfolio_image_wrap">
            <img src="images/test_image_2.png" alt="Move Me On" />
            <h3 class="portfolio_description">Move Me On</h3>
        </div></a>

       <a href="move_me_on.php"><div class="portfolio_image_wrap">
            <img src="images/test_image_2.png" alt="Ceviche" />
            <h3 class="portfolio_description">Ceviche</h3>
        </div></a>

        <a href="the_value_engineers.php"><div class="portfolio_image_wrap">
            <img src="images/test_image_2.png" alt="Designing a Better A&E" />
            <h3 class="portfolio_description">The Value Engineers</h3>
        </div></a>

        <a href="the_house.php"><div class="portfolio_image_wrap">
            <img src="images/test_image_2.png" alt="The House" />
            <h3 class="portfolio_description">The House London</h3>
        </div></a>

        <a href="walk_free.php"><div class="portfolio_image_wrap">
            <img src="images/test_image_2.png" alt="Walk Free" />
            <h3 class="portfolio_description">Walk Free</h3>
        </div></a>

         <a href="christmas14.php"><div class="portfolio_image_wrap">
            <img src="images/test_image_2.png" alt="Christmas 2014" />
            <h3 class="portfolio_description">Christmas 2014</h3>
        </div></a>

         <a href="sue_ryder.php"><div class="portfolio_image_wrap">
            <img src="images/test_image_2.png" alt="Sue Ryder" />
            <h3 class="portfolio_description">Sue Ryder</h3>
        </div></a>

        <a href="tesco_charity_partnership.php"><div        class="portfolio_image_wrap">
            <img src="images/test_image_2.png" alt="Tesco Charity Partnership" />
            <h3 class="portfolio_description">Tesco Charity Partnership</h3>
        </div></a>


 </div>

CSS

 * {
margin:0px;
padding:0px;
 }

#portfolio {
width:100%;
height:auto;
margin-left:auto;
margin-right:auto;
 }


  .portfolio_image_wrap {
position:relative;
max-width:33%;
height:auto;
top:0;
left:0;
float:left;
 }

 .portfolio_image_wrap img {
height:auto;
max-width:100%;

  }

 .portfolio_description {
display:none;
background:#FF0066;
max-width:100%;
height:auto;
padding:10px;
text-decoration:none;
font-size:0px;
color:#fff;
position:absolute;
top:0px;
left:0px;
visibility:hidden;
opacity:0;
 }

 .portfolio_image_wrap:hover .portfolio_description {
display:block;
visibility:visible;
font-size:18px;
opacity:1;
  }

这是我的网站开发的JS Fiddle版本:

https://jsfiddle.net/hpq0s651/2/

2 个答案:

答案 0 :(得分:0)

我认为问题在于:

.portfolio_image_wrap {
    position:relative;
    max-width:33%;   /*try to set width: 33%; instead of max-width*/
    height:auto;
    top:0;
    left:0;
    float:left;
 }

更新:

width: 33.33%;

答案 1 :(得分:0)

请试试这个:

 let outputPath : NSString = NSString(format: "%@%@", NSTemporaryDirectory(), "output.mov")

    let outputURL : NSURL = NSURL(fileURLWithPath: outputPath as String)!

    let fileManager : NSFileManager = NSFileManager.defaultManager()

    if(fileManager.fileExistsAtPath(outputPath as String))
    {
        let asset : AVURLAsset = AVURLAsset(URL: outputURL, options: nil)
        if let clipVideoTrack: AVAssetTrack = asset.tracksWithMediaType(AVMediaTypeVideo)[0] as? AVAssetTrack
        {

            var videoComposition: AVMutableVideoComposition = AVMutableVideoComposition()
            videoComposition.frameDuration = CMTimeMake(1, 60)

            print(clipVideoTrack.naturalSize.height)

            videoComposition.renderSize = CGSizeMake(612,612)

            var instruction: AVMutableVideoCompositionInstruction = AVMutableVideoCompositionInstruction()
            instruction.timeRange = CMTimeRangeMake(kCMTimeZero, CMTimeMakeWithSeconds(60, 30))
            var transformer: AVMutableVideoCompositionLayerInstruction =
            AVMutableVideoCompositionLayerInstruction(assetTrack: clipVideoTrack)

            var t1: CGAffineTransform = CGAffineTransformMakeTranslation(clipVideoTrack.naturalSize.height, 0)

            var t2: CGAffineTransform = CGAffineTransformRotate(t1, CGFloat(M_PI_2))

            var finalTransform: CGAffineTransform = t2

             transformer.setTransform(finalTransform, atTime: kCMTimeZero)
            instruction.layerInstructions = NSArray(object: transformer) as [AnyObject]

            videoComposition.instructions = NSArray(object: instruction) as [AnyObject]


            let exportPath : NSString = NSString(format: "%@%@", NSTemporaryDirectory(), "output2.mov")

            var exportUrl: NSURL = NSURL.fileURLWithPath(exportPath as! String)!
            if(fileManager.fileExistsAtPath(exportPath as String))
            {
                var error:NSError? = nil
                if(fileManager.removeItemAtPath(exportPath as String, error: &error))
                {
                    //Error - handle if requried
                }
            }

            var exporter = AVAssetExportSession(asset: asset, presetName: AVAssetExportPresetHighestQuality)
            exporter.videoComposition = videoComposition
            exporter.outputFileType = AVFileTypeQuickTimeMovie
            exporter.outputURL = exportUrl
            exporter.exportAsynchronouslyWithCompletionHandler({ () -> Void in

                dispatch_async(dispatch_get_main_queue()) {
                    () -> Void in
                    let outputURL:NSURL = exporter.outputURL;
                    self.videoURL = outputURL
                    let asset:AVURLAsset = AVURLAsset(URL: outputURL, options: nil)

                }

            })

        }


    }

}

   #portfolio {
      width:100%;
      height:auto;
      margin-left:auto;
      margin-right:auto;
      border:none !important;
      outline:none !important;