Table of Contents
回复内容:
Home Backend Development PHP Tutorial javascript - html伸缩式侧边栏代码?

javascript - html伸缩式侧边栏代码?

Jun 06, 2016 pm 08:22 PM
css html html5 javascript php

类似于这种 http://www.htmleaf.com/Demo/20141010127.html 。
求简单的写个例子,可以用jquery。
或者给我一个思路也行。

<code>


    <meta charset="UTF-8">
    <title>Document</title>
    <style type="text/css">
    **        {margin: 0;padding: 0;}
    #menu     {width: 100%;height: 50px;position: absolute;top: 100px;background-color: #31223b;}
    #sidebar  {width: 50px;height: 50px;background-color: #ffbbbb;}
    </style>


    <div id="menu">
        <div id="sidebar"></div>
    </div>



 基本布局我已经写好了,代码编辑器竟然不支持 * 选择器!所以我写了两个 * 号!
 </code>
Copy after login
Copy after login

顺便问一下,用sublime的有吗?快捷方式写出来的基本html文档中,怎么改成?

回复内容:

类似于这种 http://www.htmleaf.com/Demo/20141010127.html 。
求简单的写个例子,可以用jquery。
或者给我一个思路也行。

<code>


    <meta charset="UTF-8">
    <title>Document</title>
    <style type="text/css">
    **        {margin: 0;padding: 0;}
    #menu     {width: 100%;height: 50px;position: absolute;top: 100px;background-color: #31223b;}
    #sidebar  {width: 50px;height: 50px;background-color: #ffbbbb;}
    </style>


    <div id="menu">
        <div id="sidebar"></div>
    </div>



 基本布局我已经写好了,代码编辑器竟然不支持 * 选择器!所以我写了两个 * 号!
 </code>
Copy after login
Copy after login

顺便问一下,用sublime的有吗?快捷方式写出来的基本html文档中,怎么改成?

给三个 class 分别对应隐藏,图标模式,全部模式三个模式下的宽度,然后在对应的事件上绑定相应的 class 就好了。
标签快捷补完是 emmet 的功能,只需要 html 的话可以直接输入 html 然后 tab,如果是要修改语言的话需要 ![lang=zh-cn] 或者你也可以 !!!doc 两个配合使用,更多的快捷方式可以查看 emmit cheatsheet 自己在 config 里面定义一个快捷模板,这个可以查阅官方 readme 了解更多。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to use bootstrap in vue How to use bootstrap in vue Apr 07, 2025 pm 11:33 PM

Using Bootstrap in Vue.js is divided into five steps: Install Bootstrap. Import Bootstrap in main.js. Use the Bootstrap component directly in the template. Optional: Custom style. Optional: Use plug-ins.

The Roles of HTML, CSS, and JavaScript: Core Responsibilities The Roles of HTML, CSS, and JavaScript: Core Responsibilities Apr 08, 2025 pm 07:05 PM

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

What Does H5 Refer To? Exploring the Context What Does H5 Refer To? Exploring the Context Apr 12, 2025 am 12:03 AM

H5referstoHTML5,apivotaltechnologyinwebdevelopment.1)HTML5introducesnewelementsandAPIsforrich,dynamicwebapplications.2)Itsupportsmultimediawithoutplugins,enhancinguserexperienceacrossdevices.3)SemanticelementsimprovecontentstructureandSEO.4)H5'srespo

Understanding HTML, CSS, and JavaScript: A Beginner's Guide Understanding HTML, CSS, and JavaScript: A Beginner's Guide Apr 12, 2025 am 12:02 AM

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

React's Role in HTML: Enhancing User Experience React's Role in HTML: Enhancing User Experience Apr 09, 2025 am 12:11 AM

React combines JSX and HTML to improve user experience. 1) JSX embeds HTML to make development more intuitive. 2) The virtual DOM mechanism optimizes performance and reduces DOM operations. 3) Component-based management UI to improve maintainability. 4) State management and event processing enhance interactivity.

How can you prevent a class from being extended or a method from being overridden in PHP? (final keyword) How can you prevent a class from being extended or a method from being overridden in PHP? (final keyword) Apr 08, 2025 am 12:03 AM

In PHP, the final keyword is used to prevent classes from being inherited and methods being overwritten. 1) When marking the class as final, the class cannot be inherited. 2) When marking the method as final, the method cannot be rewritten by the subclass. Using final keywords ensures the stability and security of your code.

Is h5 same as HTML5? Is h5 same as HTML5? Apr 08, 2025 am 12:16 AM

"h5" and "HTML5" are the same in most cases, but they may have different meanings in certain specific scenarios. 1. "HTML5" is a W3C-defined standard that contains new tags and APIs. 2. "h5" is usually the abbreviation of HTML5, but in mobile development, it may refer to a framework based on HTML5. Understanding these differences helps to use these terms accurately in your project.

The Future of PHP: Adaptations and Innovations The Future of PHP: Adaptations and Innovations Apr 11, 2025 am 12:01 AM

The future of PHP will be achieved by adapting to new technology trends and introducing innovative features: 1) Adapting to cloud computing, containerization and microservice architectures, supporting Docker and Kubernetes; 2) introducing JIT compilers and enumeration types to improve performance and data processing efficiency; 3) Continuously optimize performance and promote best practices.

See all articles