Html图库(Html image gallery)
我正在尝试制作一个图库,我使用以下代码的问题是图像没有浮动到左边,因为图像的大小不同。 当我点击图像看到它的猪的全尺寸。 有没有办法解决这个问题,或者在厨房模式下显示一半的图片。
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Image Gallery</title> <link rel="stylesheet" href='css/gallery.css'> </head> <body> <div class='container'> <?php if($images):?> <div class='gallery cf'> <?php foreach($images as $image):?> <div class='gallery-item'> <a href="<?php echo $image['full'] ?>"><img src="<?php echo $image['full'] ?>" ></a> </div> <?php endforeach; ?> </div> <?php else: ?> There are no images <?php endif; ?> </div> </body> </html> .cf:before, .cf:after{ content: " "; display: table; } .cf:after{ clear:both; } .container{ max-width: 940px; padding: 10px; background: #f0f0f0; margin: 0 auto; } .gallery{ width:100%; } .gallery-item{ float:left; background: #fff; width:19%; margin:1%; padding:2%; padding-bottom: 5%; box-shadow:1px 1px 3px rgba(0,0,0,.2); } .gallery-item img{ width:100%; }
I’m trying to make an image gallery, the issues i am having with the following code is that the images are not floating to the left because the images are different sizes. also when i click on the image to see the full size its very pig. is there a way to fix this, or maybe display half of the picture when in galley mode.
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Image Gallery</title> <link rel="stylesheet" href='css/gallery.css'> </head> <body> <div class='container'> <?php if($images):?> <div class='gallery cf'> <?php foreach($images as $image):?> <div class='gallery-item'> <a href="<?php echo $image['full'] ?>"><img src="<?php echo $image['full'] ?>" ></a> </div> <?php endforeach; ?> </div> <?php else: ?> There are no images <?php endif; ?> </div> </body> </html> .cf:before, .cf:after{ content: " "; display: table; } .cf:after{ clear:both; } .container{ max-width: 940px; padding: 10px; background: #f0f0f0; margin: 0 auto; } .gallery{ width:100%; } .gallery-item{ float:left; background: #fff; width:19%; margin:1%; padding:2%; padding-bottom: 5%; box-shadow:1px 1px 3px rgba(0,0,0,.2); } .gallery-item img{ width:100%; }
原文:
更新时间:2021-09-04 12:09
最满意答案
使用
JsonConvert.DeserializeObject<Dictionary<string, object>>()
:var json = @"{""ShowMapUrl"":true,""GameDiffusionType"":5,""InputYellowCards"":false,""DisplayYellowCards"":false,""InputYellowCards2"":false}"; var dict = JsonConvert.DeserializeObject<Dictionary<string, object>>(json);
Use
JsonConvert.DeserializeObject<Dictionary<string, object>>()
:var json = @"{""ShowMapUrl"":true,""GameDiffusionType"":5,""InputYellowCards"":false,""DisplayYellowCards"":false,""InputYellowCards2"":false}"; var dict = JsonConvert.DeserializeObject<Dictionary<string, object>>(json);
相关问答
更多-
使用以下字符串格式将服务器字符串转换为日期 dateFor.dateFormat = "yyyy-MM-dd'T'HH:mm:ss" Use the following string format to convert a server string into a Date dateFor.dateFormat = "yyyy-MM-dd'T'HH:mm:ss"
-
这个字符串的格式是什么? 可以为该属性指定对象或字符串的值。 如果给它一个对象,那么它的键和值将被格式化为application/x-www-form-urlencoded数据(就像表单提交一样)。 如果给它一个字符串,它将是该字符串的任何东西 - 所以它可以是“无论使用它的代码的作者想要它”。 我看到这种格式的网址...... 这将是“无论作者想要什么”的情况。 注意; 和&可以在许多application/x-www-form-urlencoded解码库中互换使用。 这是HTML 4规范推荐的 。 这种 ...
-
你需要做的是创建一个看起来就像你想要读/写的类: public class MySomethingSomething { public List
List1 {get; set;} public List List2 {get; set;} // etc } 然后你可以做一个myObject = new MySomethingSomething(); 并用数据填充它。 然后,您可以使用JSON.NET将myObject序列化为JSON ... -
这是因为根元素是JSON中的数组。 ServiceStack似乎扼杀了它。 如果您使用ServiceStack尝试它并添加具有相同数组的根对象作为属性,例如 var json = "{\"root\":[\"one value\",[\"another value|or this value\"]]}"; var testValue = JsonObject.Parse(json); Console.WriteLine(testValue.ToJson()); 它正确地序列化了数组。 Json.Net似乎 ...
-
我将obj变量传递给list,如下所示 modified_listofstrings.Add(obj); 然后将列表序列化如下 jSearializer.Serialize(modified_listofstrings) 声明如下, List
-
它只是序列化/反序列化。 在Javscript代码中,您通常使用该对象,因为这可以让您轻松获取其属性等,而JSON字符串对您没有多大帮助。 var jsonobj = { "arr": [ 5, 2 ], "str": "foo" }; console.log(jsonobj.arr[1] + jsonobj.str); // 2foo var jsonstr = JSON.stringify(jsonobj); // cannot do much with this 但是,要通过Ajax调用将其发送到 ...
-
你可以解析字符串。 在其中插入一个新行和x:Bind将此方法x:Bind到TextBlock.Text : private string ParseString(string jsonString) { return jsonString.Replace(",", ",\n").Replace("{", "{\n").Replace("}", "\n}"); } You may parse the string. Insert a new line into it ...
-
你的问题与这个问题类似。 检查具有@Target(value={ANNOTATION_TYPE,METHOD,FIELD}) 。 @JsonRawValue public String getInfo() { return info; } Spring Rest使用Jackson库序列化为JSON。 根据您在类路径中的库,您可以使用Jackson v1或v2。 另请查看此链接 , 该链接可以帮助您使用Jackson注释的其他示例。 Your question is similar to this one. ...
-
使用JsonConvert.DeserializeObject
>() : var json = @"{""ShowMapUrl"":true,""GameDiffusionType"":5,""InputYellowCards"":false,""DisplayYellowCards"":false,""InputYellowCards2"":false}"; var dict = JsonConvert.DeserializeObject 不要尝试将数据作为编码字符串进行操作。 在尝试应用格式之前解码JSON。 import json json_data = '{"key1":"{0}","key2":"{1}"}' format_args = ["value1", "value2"] data = json.loads(json_data) formatted_data = {key: value.format(*format_args) for key, value in data.items()} 然后,如果需要,您可以将格式化数 ...相关文章
更多- 使用HBuilder创建HTML页面
- SVG 嵌入到HTML页面
- HTML5 Video元素【HTML5教程 - 第三篇】
- HTML5元素【HTML5教程 - 第二篇】
- HTML5 Geolocation【HTML5教程 - 第十篇】
- HTML5 web存储(Web Storage)【HTML5教程 - 第十一篇】
- HTML5 Audio元素【HTML5教程 - 第五篇】
- HTML5 Video Doc【HTML5教程 - 第四篇】
- HTML5应用缓存(application cache)【HTML5教程 - 第十二篇】
- HTML5 SVG【HTML5教程 - 第八篇】
最新问答
更多- 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
- 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
- OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
- 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
- codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
- 在计算机拍照在哪里进入
- 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
- No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
- 单页应用程序:页面重新加载(Single Page Application: page reload)
- 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
- System.StackOverflow错误(System.StackOverflow error)
- KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
- 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
- android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
- TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
- 企业安全培训的各项内容
- 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
- C#类名中允许哪些字符?(What characters are allowed in C# class name?)
- NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
- 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
- 将多个行和可变行移动到列(moving multiple and variable rows to columns)
- 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
- 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
- Angular $资源不会改变方法(Angular $resource doesn't change method)
- 在Angular 5中不是一个函数(is not a function in Angular 5)
- 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
- 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
- 常见的python rpc和cli接口(Common python rpc and cli interface)
- Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
- 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)