sidebar

浅谈CSS代码管理OOCSS、SMACSS、BEMCSS三种设计模式

六眼飞鱼酱① 提交于 2019-12-10 02:46:50
面向对象的OOCSS,是由Nicole Sullivan提出的css理论,虽说是理论,实则更像一种程序员约定的规范。 是一种把面向对象方法学应用到 CSS 代码组织和管理中的实践。面向对象方法学中的很多理念,如模块化、单一功能原则(Single responsibility principle)和关注点分离(Separation of concerns)等,对于需要组织和管理大量 CSS 代码的应用也是适用的。OOCSS 提出了 CSS 对象的概念,用来表示重复出现的可视化模式。这些模式可以被抽象成独立的 HTML、CSS 和 JavaScript 代码片段,并在整个项目中共享。 有两个重要的原则: 第一个原则是把结构和外观分开。重复出现的可视化模式应该只关注外观,而与 DOM 结构无关。这样可以提高 CSS 对象的可复用性。 第二个原则是把容器和内容分开。这就要求在 CSS 样式中不应该出现与 DOM 树中的位置相关的规则。CSS 样式应该只关注内容,而不是 DOM 元素及其层次关系。 <div class="demo-list"> <ul> <li><a href="#">...</a></li> <li><a href="#">...</a></li> <li><a href="#">...</a></li> </ul> </div> 对a修改样式可能用.demo-list

Creating custom sidebar wordpress

给你一囗甜甜゛ 提交于 2019-12-08 13:48:40
问题 I want to create custom right sidebar for my wordpress site. Something like this wordpress_right_sidebar It should be totally responsible. I'm going to post more items. What are the things i gotta need? 回答1: Add this code into functions.php in order to register your custom sidebar: function my_custom_sidebar() { register_sidebar( array ( 'name' => __( 'Custom', 'your-theme-domain' ), 'id' => 'custom-side-bar', 'description' => __( 'Custom Sidebar', 'your-theme-domain' ), 'before_widget' => '

How to change centerview on click of tableview row of leftsidecontroller in iphone?(MFSideMenu)

为君一笑 提交于 2019-12-08 13:03:43
问题 am using MFSideMenu for my iphone app to implement a side bar. I have successfully implemented the sidebar. with the following code in my appdelegete - (ViewController *)demoController { return [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil]; } - (UINavigationController *)navigationController { return [[UINavigationController alloc] initWithRootViewController:[self demoController]]; } - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:

Javascript make sidebar “scroll” with the page until its bottom edge hits footer

孤街醉人 提交于 2019-12-08 07:33:28
问题 Javascript make sidebar "scroll" with the page until its bottom edge hits footer. The point is that I have this sidebar that should scroll along with the page and stop when its bottom edge hits the top edge of footer - after that point it should behave by default(be static again), which can be seen here: http://zakuvavanje.rs/ . This question is similar to this one jQuery scrolling DIV: stop scrolling when DIV reaches footer , I didn't want to ask the question, however I had no idea how to

How to close a sidebar in firefox

大憨熊 提交于 2019-12-07 22:56:44
问题 I have a sidebar inside my firefox addon. I want the following behavior for this sidebar - I should force close the sidebar if it is open when the browser is being closed (so that the next time the browser is opened the sidebar is not in an open state). I am trying to do this: uninit: function() { var sidebarWindow = document.getElementById("sidebar").contentWindow; if (sidebarWindow.location.href == "chrome://myaddon/content/mysidebar.xul") { // Act on the sidebar content toggleSidebar(

HTML/CSS: How to make the sidebar and content follow each other

只愿长相守 提交于 2019-12-07 14:32:24
问题 I need a sidebar and a content area. I want to have equal height for both sections. So if I want to specify a background color for the sidebar, it will follow the content area even if the sidebar's contents are not as tall as the content section and vice versa. I want to make this in pure HTML and CSS only, so no javascript tricks. 回答1: The only real way of doing this in a cross browser fashion is with tables. As content is added to the sidebar cell below, it will force the entire row to

Visual Studio code sidebar Vertical guideline (customize sidebar)

允我心安 提交于 2019-12-07 13:24:07
问题 Does anybody know an extension for Visual Studio code to show a vertical guideline on sidebar (for file and folders) like netbeans? Or maybe have some settings in vscode? Netbeans Snapshot Thanks for your help. 回答1: As of June, you can add guidelines with: "workbench.tree.renderIndentGuides": "always", // Can also be set to "onHover" You can also change their color with: "workbench.colorCustomizations": { "tree.indentGuidesStroke": "#008070" }, And if you want to change the indentation width,

两个viewport的故事-桌面版(译)

自作多情 提交于 2019-12-07 11:00:27
王亚辉 | 发表于 2017-03-29 网易乐得技术团队 在这个系列文章中,我将说明viewports和重要元素的宽度是如何工作的,比如html元素、window和 scrren的宽度。这篇文章是关于桌面浏览器的,目的是为介绍移动浏览器做好准备。大部分的web开发者已经对桌面浏览器的一些概念很熟悉了。在移动浏览器上我们会发现同样的概念,只不过要更复杂一些,回顾一下这些熟悉的概念将对我们理解移动浏览器有很大的帮助。 设备像素和css像素 你需要理解的第一个概念是css像素和设备像素之间的区别。 设备像素,顾名思义,无论你用什么设备,设备像素都是表示设备的实际分辨率。设备像素可以从 screen.width/height 读取。 如果你给一个元素 widht:128px ,你的显示器是1024px宽,你最大化你的浏览器,这个元素可以在屏幕上平铺8个。(大概;忽略一些不确定因素) 如果用户缩放了页面,这个值将发生改变。如果用户放大浏览器到200%,你的128px的元素只能在屏幕上平铺4个了。 用户缩放在浏览器中是通过拉伸像素实现的。也就是说,元素的宽度并没有从128px变成256px,而是像素的尺寸变成了原来的两倍。综上,这个元素仍旧有128px的css像素,但是此时它却占有256px的设备像素。 换句话说,放到到200%使一个css像素尺寸了变成了4倍的设备像素的尺寸。(两倍的宽

Apps Script Sidebar Reference Error When Using Include

倖福魔咒の 提交于 2019-12-07 02:43:05
问题 I created a Google Apps Script add-on to display a sidebar on click: function displayPage_() { getScriptProperties_() var htmlTemplate = HtmlService.createTemplateFromFile('PAGE'); var html = htmlTemplate.evaluate() .setTitle('Connector'); SpreadsheetApp.getUi().showSidebar(html); } This successfully loads the file PAGE.html as long as it is simple html. However, when I try to add include like this: <!DOCTYPE html> <html> <head> <base target="_top"> <?!= include("STYLESHEET"); ?> </head>

How can I position the window's position on startup to the right side of the user's screen?

送分小仙女□ 提交于 2019-12-06 19:01:22
问题 I am currently creating a sidebar-like WPF application in C#. When a user starts the application, I would like the window to automatically position it's self to the side of the user's screen. I have tried a few methods and google searches, but have not found any help. Here's an example of what I'm trying to do: http://prntscr.com/5tfkz How can I efficiently go about achieving something like this? @dknaack I tried this code: private void Window_Loaded(object sender, RoutedEventArgs e) { this