首页 \ 问答 \ CSS calc百分比宽度和除法(CSS calc percentage width and division)

CSS calc百分比宽度和除法(CSS calc percentage width and division)

我的菜单是一个包含三个列表项的列表:

<ul class="menu_container">
  <li class="item">Item1</li>
  <li class="item">Item2</li>
  <li class="item">Item3</li>
</ul>

在调整浏览器大小时,ul元素的宽度会发生变化,我正在尝试使用calc来训练项目的宽度,使它们相等。 第一个和第三个列表项具有2px宽的左右边框。

在Chrome开发工具中,menu_container的宽度为636px。 如果我检查第一个列表项并执行width: 100%它显示640px。 但如果我做calc((100% - 12px) / 3)它的宽度显示为212px。 为什么这不是(640 - 12)/ 3 = 209.333?


I have menu which is a list with three list-items:

<ul class="menu_container">
  <li class="item">Item1</li>
  <li class="item">Item2</li>
  <li class="item">Item3</li>
</ul>

The width of the ul element changes as you resize the browser and I'm trying to use calc to workout the widths of the items so that they are equal. The first and third list-items have a 2px wide left and right border.

In the Chrome dev tools the width of menu_container is 636px. If I inspect the first list-item and do width: 100% it shows 640px. But if I do calc((100% - 12px) / 3) it shows 212px for the width. Why is this not (640 - 12) / 3 = 209.333?


原文:https://stackoverflow.com/questions/34680174
更新时间:2022-03-21 12:03

最满意答案

它可能是Windows安全功能,称为用户界面Privelage隔离 。 这是不允许较低完整性过程与较高完整性过程通信的地方。

这被添加到Windows Vista中以防止所谓的粉碎攻击

安全问题是恶意应用程序可以尝试与提升的MatLab进程通信,可能使用它来写入安全位置。

例如,您的C#应用​​程序正在尝试使用MatLab来保存硬盘驱动器上的文件。


It is probably the Windows security feature known as User Interface Privelage Isolation. This is where a lower integrity process is not allowed to communicate with a higher integrity process.

This was added to Windows Vista to prevent what's known as a Shatter Attack.

The security concern is that a malicious application can try to communicate with an elevated MatLab process, possibly using it to write to secure locations.

For example, your C# application is attempting to use MatLab in order to save files on the hard drive.

相关问答

更多
  • 我想你正在寻找'runas'命令。 您可以说目标程序的命令行参数是: runas /savecred /user:administrator "yourprogrampathhere.exe" 只需确保名为“administrator”的用户确实存在。 顺便说一句,快捷方式的属性窗口中有一个标志,我只是不知道如何用WShell方式做到这一点,但这个解决方案可能有效。 这条线需要改变: MyShortcut.TargetPath = WSH.ExpandEnvironmentStrings("runas ...
  • 设置嵌入式清单以要求管理员。 在项目属性页面上: ...在(突出显示的) UAC Execution Level ,将asInvoker更改asInvoker requireAdministrator 。 构建你的项目以嵌入新的清单,它应该准备好做它的事情。 哦 - 我不想在这里做,但在Configuration下拉列表中,您可能想要选择All Configurations ,而不是在屏幕截图中选择的(默认) Active配置。 变得非常讨厌 - 你认为你已经解决了问题,然后你改为“发布”,一堆东西突然中断 ...
  • 仅适用于所有用户的文件夹。 只有管理员才能为所有用户安装。 每用户启动文件夹位于%appdata%\Microsoft\Windows\Start Menu\Programs\Startup Only for the All User's folder. Only Admins can install for all users. The per user startup folder is at %appdata%\Microsoft\Windows\Start Menu\Programs\Startup ...
  • 这是因为用户帐户控制(UAC)。 在Vista中引入,这改变了管理员用户帐户的运行方式。 当管理员组中的用户登录时,将为用户分配两个令牌:具有所有权限的令牌和具有降低权限的令牌。 当该用户创建新进程时,默认情况下该进程将使用简化权限令牌。 因此,虽然用户具有管理员权限,但默认情况下她不会使用它们。 这是一个“好东西”™。 要行使这些权利,用户必须以提升的权限启动该过程。 例如,通过使用“以管理员身份运行”动词。 当她这样做时,完整的令牌将被移交给新流程,并且可以行使全部权利。 您几乎肯定不想检测您的进程是否 ...
  • 使用 EXEC rdsadmin.rdsadmin_util.grant_apex_admin_role; 代替。 我在AWS上打开了一个案例,并要求他们更新文档页面。 Use EXEC rdsadmin.rdsadmin_util.grant_apex_admin_role; instead. I have a case open on this with AWS and just asked them to update the documentation page.
  • 你有路由和组名称相同的“管理员” 我的路由建议: Route::get('/', 'HomeController@index'); Route::group(['prefix' => 'administrator'], function() { Route::get('/', 'Administrator\IndexController@index'); Route::get('login', 'Administrator\IndexController@login'); Route ...
  • 我勤奋的父亲通过不使用重定向操作符解决了这个问题,而是将输出汇总到Powershell自己的out-file或export-csv ,这样命令就变成了PowerShell powershell Get-VM | export-csv out.csv powershell Get-VM | export-csv out.csv 。 然后我在PHP中解析它并将其转换为表。 奇迹般有效。 My diligent father has solved the problem, by not using redirec ...
  • 它可能是Windows安全功能,称为用户界面Privelage隔离 。 这是不允许较低完整性过程与较高完整性过程通信的地方。 这被添加到Windows Vista中以防止所谓的粉碎攻击 。 安全问题是恶意应用程序可以尝试与提升的MatLab进程通信,可能使用它来写入安全位置。 例如,您的C#应用程序正在尝试使用MatLab来保存硬盘驱动器上的文件。 It is probably the Windows security feature known as User Interface Privelage Is ...
  • 您可以在快捷方式本身中设置工作目录,也可以不从工作目录( %CD% )运行Setup.exe,而是从脚本所在的目录运行: start "" "%~dp0\Setup.exe" 与之前的答案不同的是,不需要cd到%~dp0 。 只需使用完整路径运行安装程序。 You can either set the working directory in the shortcut itself, or run Setup.exe not from working directory (%CD%) but from d ...
  • COM系统将拒绝在不同安全上下文中的两个COM对象之间编组调用。 确保您的应用和Outlook在相同的上下文中运行。 COM system will refuse to marshal calls between 2 COM objects in different security contexts. Make sure both your app and Outlook are running in the same context.

相关文章

更多

最新问答

更多
  • 您如何使用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)