Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/haskell/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 尝试将列表项居中对齐_Html_Css - Fatal编程技术网

Html 尝试将列表项居中对齐

Html 尝试将列表项居中对齐,html,css,Html,Css,我尝试了margin:0自动对齐和文本对齐,以各种元素为目标,但无法使图像库居中。。。我应该使用什么样的CSS组合,我必须针对什么div、ul或li 以下是HTML: <ul class="loop"> <ul id="portfolio-filter"><li><a href="#all" title="" class="current">All</a></li><li><a href="#de

我尝试了margin:0自动对齐和文本对齐,以各种元素为目标,但无法使图像库居中。。。我应该使用什么样的CSS组合,我必须针对什么div、ul或li

以下是HTML:

<ul class="loop">
    <ul id="portfolio-filter"><li><a href="#all" title="" class="current">All</a></li><li><a href="#design" title="" rel="design">design</a></li><li><a href="#mobile" title="" rel="mobile">mobile</a></li><li><a href="#web" title="" rel="web">web</a></li></ul> <ul id="portfolio-list">

    <li class="fourcol rad_big mobile" style="">

        <div class="item_full item_height1">

            <div class="imgwrap">

                    <span class="cats"><h3><a href="http://zappend.com/myportfolio/another-mobile-project/">Another mobile project</a></h3>
                    <p>history app</p>
                    </span>

                    <a href="http://zappend.com/myportfolio/another-mobile-project/">

                        <img width="300" height="199" src="http://zappend.com/wp-content/uploads/2013/11/bg-300x199.jpg" class="attachment-folio wp-post-image" alt="bg" title="" style="opacity: 1;">                        
                    </a>

            </div>  

            <div style="clear:both"></div>

            <a class="hoverstuff-zoom" rel="prettyPhoto[gallery]" href="http://zappend.com/wp-content/uploads/2013/11/bg.jpg" style="opacity: 0;"><i class="icon-fullscreen"></i></a>
            <a class="hoverstuff-link" href="http://zappend.com/myportfolio/another-mobile-project/" style="opacity: 0;"><i class="icon-signout"></i></a>

        </div>          </li>


    <li class="fourcol rad_big design" style="">

        <div class="item_full item_height1">

            <div class="imgwrap">

                    <span class="cats"><h3><a href="http://zappend.com/myportfolio/design-project-1/">Design Project 1</a></h3>
                    <p>city of birmingham HDR</p>
                    </span>

                    <a href="http://zappend.com/myportfolio/design-project-1/">

                        <img width="300" height="199" src="http://zappend.com/wp-content/uploads/2013/11/city-300x199.jpg" class="attachment-folio wp-post-image" alt="city" title="" style="opacity: 1;">                        
                    </a>

            </div>  

            <div style="clear:both"></div>

            <a class="hoverstuff-zoom" rel="prettyPhoto[gallery]" href="http://zappend.com/wp-content/uploads/2013/11/city.jpg" style="opacity: 0;"><i class="icon-fullscreen"></i></a>
            <a class="hoverstuff-link" href="http://zappend.com/myportfolio/design-project-1/" style="opacity: 0;"><i class="icon-signout"></i></a>

        </div>          </li>


    <li class="fourcol rad_big web" style="">

        <div class="item_full item_height1">

            <div class="imgwrap">

                    <span class="cats"><h3><a href="http://zappend.com/myportfolio/website-project/">Website Project</a></h3>
                    <p>zappend website</p>
                    </span>

                    <a href="http://zappend.com/myportfolio/website-project/">

                        <img width="300" height="199" src="http://zappend.com/wp-content/uploads/2013/11/main-slider-300x199.jpg" class="attachment-folio wp-post-image" alt="main-slider" title="" style="opacity: 1;">                        
                    </a>

            </div>  

            <div style="clear:both"></div>

            <a class="hoverstuff-zoom" rel="prettyPhoto[gallery]" href="http://zappend.com/wp-content/uploads/2013/11/main-slider.jpg" style="opacity: 0;"><i class="icon-fullscreen"></i></a>
            <a class="hoverstuff-link" href="http://zappend.com/myportfolio/website-project/" style="opacity: 0;"><i class="icon-signout"></i></a>

        </div>          </li>


    <li class="fourcol rad_big mobile" style="">

        <div class="item_full item_height1">

            <div class="imgwrap">

                    <span class="cats"><h3><a href="http://zappend.com/myportfolio/mobile-app/">Mobile App</a></h3>
                    <p>Zappend App</p>
                    </span>

                    <a href="http://zappend.com/myportfolio/mobile-app/">

                        <img width="300" height="199" src="http://zappend.com/wp-content/uploads/2013/11/mobile-app-slider-300x199.png" class="attachment-folio wp-post-image" alt="mobile-app-slider" title="" style="opacity: 1;">                        
                    </a>

            </div>  

            <div style="clear:both"></div>

            <a class="hoverstuff-zoom" rel="prettyPhoto[gallery]" href="http://zappend.com/wp-content/uploads/2013/11/mobile-app-slider.png" style="opacity: 0;"><i class="icon-fullscreen"></i></a>
            <a class="hoverstuff-link" href="http://zappend.com/myportfolio/mobile-app/" style="opacity: 0;"><i class="icon-signout"></i></a>

        </div>          </li>

    </ul>
</ul>
      • 历史应用程序

      • 伯明翰市HDR

      • zappend网站

      • Zappend应用程序


哈哈,你知道怎么还能把桌子放在中间吗? 我昨天遇到了这个问题,我把我的东西放在一张桌子上,放在中间(但这只是短期的,在移动浏览器上看起来很糟糕。啊哈,但是是的,你可以用一些css来做到这一点。将你的边距0自动css设置为重要。有时其他css会在html文件中的css上呈现。这就是为什么最好将它存储在其他位置,并且看起来更好。无论如何,检查一下是否是这样的,在nic中加载你的站点。)使用类似chrome的浏览器,右键单击并选择inspect elements,然后单击受影响的图像,查看正在运行的css和未运行的css

看看这个中心的东西它实际上真的很好啊哈


尝试将
min width
width
属性添加到图像的父div的CSS中。是的,我尝试了所有这些,我需要保留我的响应性设计…浮动div在这种情况下效果不好。