مشکل در CSS
سلام دوستان خسته نباشید بنده میخام طبق شکل زیر زیر منو هارو مرتب کنم باچه دستوری در CSS باید این کاروبکنم ممنون میشم منو راهنمایی بفرمایید؟کارم ضروریه؟
لازم به ذکر است که من دستور Right:-1px رو هم اضافه کردم درست میشه ولی مطابق شکل زیر یه قسمت پس زمینه sub mrnu رونشون نمیده ؟
5 پاسخ
ممنون ازپاسختون ، اینم کد برنامه ممنون میشم منو راهنمایی بفرمایید کارم خیلی ضروریه؟
.clearfix:before, .clearfix:after { display: table; content: ""; line-height: 0; } .clearfix:after { clear: both; } .hide-text { color: transparent; text-shadow: none; background-color: transparent; border: 0; } .input-block-level { display: block; width: 100%; min-height: 30px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } .btn { display: inline-block; padding: 4px 14px; margin-bottom: 0; font-size: 14px; line-height: 20px; text-align: center; vertical-align: middle; cursor: pointer; -webkit-transition: all 400ms; -moz-transition: all 400ms; -o-transition: all 400ms; transition: all 400ms; background-image: none; border: none; text-shadow: none; border-bottom-color: transparent; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } .btn:hover { text-decoration: none; -webkit-transition: all 400ms; -moz-transition: all 400ms; -o-transition: all 400ms; transition: all 400ms; } .btn:focus { outline: thin dotted #333; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } .btn.active, .btn:active { background-color: #e6e6e6; background-image: none; outline: 0; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } .btn.disabled, .btn[disabled] { cursor: default; background-color: #e6e6e6; background-image: none; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } .btn-large { padding: 9px 14px; font-size: 16px; line-height: normal; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } .btn-large [class^="icon-"] { margin-top: 2px; } .btn-small { padding: 3px 9px; font-size: 12px; line-height: 18px; } .btn-small [class^="icon-"] { margin-top: 0; } .btn-mini { padding: 2px 6px; font-size: 11px; line-height: 16px; } .btn-block { display: block; width: 100%; padding-left: 0; padding-right: 0; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } .btn-block + .btn-block { margin-top: 5px; } .btn-primary.active, .btn-warning.active, .btn-danger.active, .btn-success.active, .btn-info.active, .btn-inverse.active { color: rgba(255,255,255,0.75); } .btn { border-color: #c5c5c5; border-color: rgba(0,0,0,0.15) rgba(0,0,0,0.15) rgba(0,0,0,0.25); } .btn-default { background: none; border: 1px solid #bfbfbf; color: #999; text-shadow: none; } .btn-default:hover, .btn-default:focus { background: #eee; border: 1px solid #bfbfbf; color: #999; } .btn-primary { background: #69bd43; } .btn-primary:hover, .btn-primary:focus { background: #78c456; } .btn-warning:hover, .btn-warning:focus { background: #c87f0a; } .btn-danger { background: #c0392b; } .btn-danger:hover, .btn-danger:focus { background: #962d22; } .btn-success:hover, .btn-success:focus { background: #25a236; } .btn-info { background: none; border: 1px solid #69bd43; color: #999; text-shadow: none; } .btn-info:hover, .btn-info:focus { background: none; border: 1px solid #999; color: #69bd43; } .btn-inverse { background: #333; } .btn-inverse:hover, .btn-inverse:focus { background: #222; } button.btn, input[type="submit"].btn { padding-top: 3px; padding-bottom: 3px; } button.btn::-moz-focus-inner, input[type="submit"].btn::-moz-focus-inner { padding: 0; border: 0; } button.btn.btn-large, input[type="submit"].btn.btn-large { padding-top: 7px; padding-bottom: 7px; } button.btn.btn-small, input[type="submit"].btn.btn-small { padding-top: 3px; padding-bottom: 3px; } button.btn.btn-mini, input[type="submit"].btn.btn-mini { padding-top: 1px; padding-bottom: 1px; } .btn-link, .btn-link:active { background-color: transparent; background-image: none; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } .btn-link { border-color: transparent; cursor: pointer; color: #049cdb; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .btn-link:hover { color: #000000; text-decoration: underline; background-color: transparent; } a, a:hover { text-decoration: none; -webkit-transition: all 200ms; -moz-transition: all 200ms; -o-transition: all 200ms; transition: all 200ms; } .page-header { padding-bottom: 10px; margin: 0 0 20px; } .entry-meta.muted { position: relative; background: none; border: 1px solid #e6e6e6; color: #bfbfbf; padding: 15px; margin-bottom: 10px; font-size: 12px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } .entry-meta.muted >span, .entry-meta.muted >time { margin: 0 5px; font-size: 14px; } .entry-meta ul { margin: 0 5px; } .entry-meta ul.actions { float: right; } .entry-meta ul.actions li { display: inline-block; } .entry-meta ul.actions li.print-icon a::before { content: "\f02f"; } .entry-meta ul.actions li.email-icon a::before { content: "\f003"; } .entry-meta ul.actions li.edit-icon a::before { content: "\f044"; } .entry-meta ul.actions li a { font-family: FontAwesome; display: block; font-size: 14px; margin-left: 5px; } .entry-meta ul.actions li a img { display: none; } .entry-meta ul.actions li a span { display: none; } ul { padding-left: 0; } ul.pagenav { list-style: none; padding: 0; clear: both; margin-top: 10px; margin-left: 0; overflow: hidden; } ul.pagenav .pagenav-prev { float: left; } ul.pagenav .pagenav-next { float: right; } dl dt, dl dd { display: inline; } label.invalid { color: #c83025; } .pagination ul > li > a, .pagination ul > li > span { background: none !important; border: 1px solid #bfbfbf !important; -webkit-border-radius: 5px !important; -moz-border-radius: 5px !important; border-radius: 5px !important; color: #999 !important; text-shadow: none; opacity: 1 !important; padding: 10px 15px; margin-right: 5px; } .pagination ul > li > a:hover, .pagination ul > li > a:focus, .pagination ul > li > span:hover, .pagination ul > li > span:focus { background: #eee !important; border: 1px solid #bfbfbf !important; color: #999 !important; } .readmore { bottom: 30px !important; padding: 10px; background: none; border: 1px solid #bfbfbf; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; color: #999; text-shadow: none; } .readmore:hover, .readmore:focus { background: #eee; border: 1px solid #bfbfbf; color: #999; } .center { text-align: center; } .center th, .center tr, .center td { text-align: center; } .row-fluid { margin-bottom: 20px; } .row-fluid:first-child { margin-bottom: 0; } #sp-toolbar-r { color: #fff; padding: 0; text-align: right; } #sp-toolbar-l { color: #fff; padding: 0; font-size: 12px; } #sp-header-wrapper { padding: 35px 0; -webkit-transition: all 500ms; -moz-transition: all 500ms; -o-transition: all 500ms; transition: all 500ms; } #sp-header-wrapper .logo-wrapper .logo { background-position: 0 50%; background-repeat: no-repeat; } #sp-header-wrapper .logo-wrapper .logo-text { font-size: 24px; } #sp-header-wrapper .logo-wrapper .logo-slogan { font-size: 11px; } .body-innerwrapper { overflow-x: hidden; } #sp-main-body-wrapper { padding: 35px 0; border-top: 1px solid #fff; border-bottom: 1px solid #fff; } #sp-feature-wrapper { padding: 0; text-align: center; } #sp-feature-wrapper #feature { color: #fff; } #sp-feature-wrapper #feature h1 { color: #fff; font-size: 72px; line-height: 100px; font-weight: 400; margin-bottom: 10px; } #sp-feature-wrapper #feature p { font-size: 24px; line-height: 120%; } #sp-middle-wrapper { padding: 35px 0; background: #fff; border-bottom: 1px solid #ebebeb; } #sp-intop-wrapper { padding: 35px 0; background: #f2f2f2; border-bottom: 1px solid #ebebeb; } #sp-users-wrapper { padding: 35px 0; border-top: 1px solid #f2f2f2; border-bottom: 1px solid #f2f2f2; background-image: url("../images/geometry.png"); } #sp-users-wrapper a:not(.btn) { color: #3f7228; } #sp-users-wrapper a:not(.btn):hover { color: #fff; } #sp-inner-wrapper { padding: 35px 0; background: #f2f2f2; border-bottom: 1px solid #ebebeb; } ul.breadcrumb { margin: 0; padding-left: 0; padding-right: 0; background: transparent; } .sp-border { position: relative; } .sp-border::after { content: " "; position: absolute; top: 0; left: 0; width: 100%; height: 1px; } #sp-position1, #sp-position2, #sp-position3, #sp-position4 { padding: 35px 0; } #sp-footer-wrapper { padding: 30px 0; line-height: 30px; position: relative; } #sp-footer-wrapper::after { content: " "; position: absolute; top: 0; left: 0; width: 100%; height: 1px; } #sp-footer-wrapper ul li { display: inline-block; margin-left: 10px; font-size: 12px; } #sp-footer-wrapper ul li a { color: #999; } #sp-footer-wrapper ul { display: inline-block; } #sp-footer-wrapper ul.nav { display: inline-block; list-style: none; padding: 0; margin: 0 5px; } #sp-footer-wrapper ul.nav li { display: inline-block; margin: 0 5px; } #sp-footer-wrapper ul.nav li a { display: block; } #sp-footer-wrapper ul.nav li a:hover { background: none; } #sp-footer-wrapper .sp-totop { display: inline-block; } #sp-footer-wrapper .sp-totop i { color: #999; } #sp-footer-wrapper .sp-totop small { display: none; } #sp-footer-wrapper .helix-framework { display: inline-block; } #sp-footer-wrapper .helix-framework .helix-logo { display: block; width: 130px; height: 40px; text-indent: -9999px; background: url(../images/helix-logo-white.png) no-repeat 0 0; } #sp-footer-wrapper .copyright { display: block; } .ltr #sp-footer-wrapper .helix-framework { float: left; margin-right: 15px; } .ltr #sp-footer-wrapper #sp-footer2 { text-align: right; } .rtl #sp-footer-wrapper .helix-framework { float: right; margin-left: 15px; } .rtl #sp-footer-wrapper #sp-footer2 { text-align: left; } button, input[type='submit'], input[type='button'], submit { display: inline-block; padding: 4px 14px; margin-bottom: 0; font-size: 14px; line-height: 20px; text-align: center; vertical-align: middle; cursor: pointer; -webkit-transition: all 400ms; -moz-transition: all 400ms; -o-transition: all 400ms; transition: all 400ms; background-image: none; border: none; text-shadow: none; border-bottom-color: transparent; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; border-color: #c5c5c5; border-color: rgba(0,0,0,0.15) rgba(0,0,0,0.15) rgba(0,0,0,0.25); } button:hover, input[type='submit']:hover, input[type='button']:hover, submit:hover { text-decoration: none; -webkit-transition: all 400ms; -moz-transition: all 400ms; -o-transition: all 400ms; transition: all 400ms; } button:focus, input[type='submit']:focus, input[type='button']:focus, submit:focus { outline: thin dotted #333; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } button.active, button:active, input[type='submit'].active, input[type='submit']:active, input[type='button'].active, input[type='button']:active, submit.active, submit:active { background-color: #e6e6e6; background-image: none; outline: 0; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } button.disabled, button[disabled], input[type='submit'].disabled, input[type='submit'][disabled], input[type='button'].disabled, input[type='button'][disabled], submit.disabled, submit[disabled] { cursor: default; background-color: #e6e6e6; background-image: none; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } button.social, input[type='submit'].social, input[type='button'].social, submit.social { color: #999; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; border: 1px solid #999; -webkit-transition: all 200ms; -moz-transition: all 200ms; -o-transition: all 200ms; transition: all 200ms; } button.social:hover, input[type='submit'].social:hover, input[type='button'].social:hover, submit.social:hover { color: #fff; border: 1px solid #fff; text-decoration: none; } .btn.social { color: #999; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; border: 1px solid #999; -webkit-transition: all 200ms; -moz-transition: all 200ms; -o-transition: all 200ms; transition: all 200ms; } .btn.social:hover { color: #fff; border: 1px solid #fff; text-decoration: none; } #sp-menu { margin-top: 4px; font-family: 'Lato', sans-serif; font-weight: 400; direction: rtl; } .rtl .sp-submenu { right: 0; } .rtl .sp-submenu.sub-level { margin-top: 30px; } .rtl .sp-submenu.sub-level.open { margin-top: 0; -webkit-transition: margin 200ms; -moz-transition: margin 200ms; -o-transition: margin 200ms; transition: margin 200ms; } .rtl .sp-submenu.sub-level-child { margin-right: 30px; } .rtl .sp-submenu.sub-level-child.open { margin-right: 0px; -webkit-transition: margin 200ms; -moz-transition: margin 200ms; -o-transition: margin 200ms; transition: margin 200ms; } .rtl .sp-submenu .megacol { float: left; } .ltr .sp-submenu { left: 0; } .ltr .sp-submenu.sub-level { margin-top: 30px; } .ltr .sp-submenu.sub-level.open { margin-top: 0; -webkit-transition: margin 200ms; -moz-transition: margin 200ms; -o-transition: margin 200ms; transition: margin 200ms; } .ltr .sp-submenu.sub-level-child { margin-left: 30px; } .ltr .sp-submenu.sub-level-child.open { margin-left: 0px; -webkit-transition: margin 200ms; -moz-transition: margin 200ms; -o-transition: margin 200ms; transition: margin 200ms; } .ltr .sp-submenu .megacol { float: left; } .sp-submenu { position: absolute; top: 0; z-index: 0; visibility: hidden; opacity: 0; } .sp-submenu .sp-submenu-wrap { background: #fff; -webkit-box-shadow: 0 3px 8px rgba(0, 0, 0, 0.125); -moz-box-shadow: 0 3px 8px rgba(0, 0, 0, 0.125); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.125); } .sp-submenu.open { z-index: 1; visibility: visible; opacity: 1; } .sp-mobile-menu { position: relative; } .sp-mobile-menu select.select-menu { width: 32px; height: 27px; opacity: 0; position: absolute; left: 0; top: 0; z-index: 1; cursor: pointer; } .f-sp-header-wrapper { padding: 5px 0 !important; position: fixed; top: 0; width: 100%; z-index: 9999; -webkit-transition: all 500ms; -moz-transition: all 500ms; -o-transition: all 500ms; transition: all 500ms; } .sp-main-menu-toggler { left: auto; right: 10px; z-index: 99999 !important; position: fixed; top: 15px !important; } .sp-dropcap { overflow: hidden; } .sp-dropcap:first-letter { color: #666; display: block; float: left; font-size: 50px; line-height: 40px; padding: 4px 8px 0 0; } ul.arrow, ul.arrow-double, ul.tick, ul.cross, ul.star, ul.rss { list-style: none; padding: 0; margin: 0; } ul.arrow li::before, ul.arrow li::after, ul.arrow-double li::before, ul.arrow-double li::after, ul.tick li::before, ul.tick li::after, ul.cross li::before, ul.cross li::after, ul.star li::before, ul.star li::after, ul.rss li::before, ul.rss li::after { font-family: FontAwesome; font-size: 11px; } .ltr ul.arrow li::before, .ltr ul.arrow-double li::before, .ltr ul.tick li::before, .ltr ul.cross li::before, .ltr ul.star li::before, .ltr ul.rss li::before { margin-right: 5px; } .ltr ul.arrow li::before { content: "\f105"; } .ltr ul.arrow-double li::before { content: "\f101"; } .ltr ul.tick li::before { content: "\f00c"; } .ltr ul.cross li::before { content: "\f00d"; } .ltr ul.star li::before { content: "\f006"; } .ltr ul.rss li::before { content: "\f09e"; } .rtl ul.arrow li::after, .rtl ul.arrow-double li::after, .rtl ul.tick li::after, .rtl ul.cross li::after, .rtl ul.star li::after, .rtl ul.rss li::after { margin-left: 5px; } .rtl ul.arrow li::after { content: "\f104"; } .rtl ul.arrow-double li::after { content: "\f100"; } .rtl ul.tick li::after { content: "\f00c"; } .rtl ul.cross li::after { content: "\f00d"; } .rtl ul.star li::after { content: "\f006"; } .rtl ul.rss li::after { content: "\f09e"; } img.pull-left, .pull-left > img { margin-right: 15px; } img.pull-right, .pull-right > img { margin-left: 15px; } .rtl img.pull-left, .rtl .pull-left > img { margin-left: 15px; } .rtl img.pull-right, .rtl .pull-right > img { margin-right: 15px; } .sp-blocknumber { position: relative; min-height: 45px; } .sp-blocknumber span { font-weight: bold; width: 48px; height: 48px; line-height: 48px; display: block; text-align: center; position: absolute; top: 0; } .sp-blocknumber span.rounded { -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } .sp-blocknumber span.circle { -webkit-border-radius: 100%; -moz-border-radius: 100%; border-radius: 100%; } .ltr .sp-blocknumber { padding: 5px 0 5px 60px; } .ltr .sp-blocknumber span { left: 0; } .rtl .sp-blocknumber { padding: 5px 60px 5px 0; } .rtl .sp-blocknumber span { right: 0; } .sp-block.rounded { -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } .sp-bubble { position: relative; margin-bottom: 40px; } .sp-bubble cite { display: block; height: 30px; line-height: 26px; position: absolute; bottom: -30px; } .sp-bubble cite span { content: ' '; position: absolute; top: 0; display: block; width: 0; height: 0; border-bottom-color: transparent !important; } .ltr .sp-bubble cite { left: 15px; padding-left: 40px; } .ltr .sp-bubble cite span { left: 0; border-left-color: transparent !important; } .rtl .sp-bubble cite { right: 15px; padding-right: 40px; } .rtl .sp-bubble cite span { right: 0; border-right-color: transparent !important; } .ltr [class^="icon-"].pull-left, .ltr [class*=" icon-"].pull-left { margin-right: .3em; } .ltr [class^="icon-"].pull-right, .ltr [class*=" icon-"].pull-right { margin-left: .3em; } .rtl [class^="icon-"].pull-left, .rtl [class*=" icon-"].pull-left { margin-left: .3em; } .rtl [class^="icon-"].pull-right, .rtl [class*=" icon-"].pull-right { margin-right: .3em; } @media (max-width: 979px) { .responsive #sp-header-wrapper [class*="span"] { width: auto; float: left; } .responsive #sp-header-wrapper [class*="span"]#sp-menu { float: right; } .responsive .sp-main-menu-toggler { top: 60px; } } @media (max-width: 767px) { .responsive.bg { padding-left: 0; padding-right: 0; } .responsive .container { padding: 0 10px; max-width: 480px; min-width: 280px; } .responsive #sp-feature-wrapper { padding: 0; } .responsive #sp-feature-wrapper #feature h1 { font-size: 200%; line-height: 200%; } .responsive #sp-feature-wrapper #feature p { font-size: 100%; } .responsive #sp-feature-wrapper #feature .btn { padding: 2px 6px; font-size: 11px; line-height: 16px; margin-bottom: 5px; } .responsive .sp-main-menu-toggler { top: 30px; } } .fixed .hidden-desktop { display: none; } .uk-icon-button { -moz-box-sizing: border-box; box-sizing: border-box; display: inline-block; width: 30px; height: 30px; border-radius: 0; background: none; line-height: 30px; font-size: 16px; text-align: center; border: none; text-shadow: none; margin-left: 2px; } .sprocket-lists .sprocket-lists-title { color: #555 !important; } .ns2-tools { margin-top: -8px; } .ns2-page-inner { position: relative; margin-top: -10px; } .ns2-created:before { content: "\f073"; font-family: FontAwesome; } h4.ns2-title { font-weight: normal !important; text-transform: uppercase; } .pad-spa { padding: 40px 0; }
دوست عزیز کد HTML هم بزار . یه بار دیگه به صورت واضح بفرمایید مشکل از کجاست ؟ این تصویر دوم که تبدیل شده چه ارتباطی با تصویر دوم داره ؟
دوست عزیز این کدی که شما نوشتی تو مرورگر من به صورت عکس زیر نمایش داده می شه . لطف کنید کد رو کامل با تمام جزییات بفرستید .
لطفا کد برنامتون رو قرار بدید .
دوست گرامی بنده میخام شکل الف رو تبدیل به شکل ب کنم همونطور که درشکل االف می بینید زیرمنوها در زیر منو ها بدرستی قرار نگرفته ممنون میشم منو راهنمایی بفرمایید؟
کد html رو هم براتون قراردام
<!DOCTYPE html> <!-- [if lt IE 7]> <html class="no-js lt-ie9 lt-ie… --> <!-- [if IE 7]> <html class="no-js lt-ie9 lt-ie… --> <!-- [if IE 8]> <html class="no-js lt-ie9" lan… --> <!-- [if gt IE 8]><! --> <html class=" js no-flexbox canvas canvastext webgl no-touch geolocation … webworkers applicationcache svg inlinesvg smil svgclippaths" lang="en-gb" slick-uniqueid="3" style=""> <!-- <![endif] --> <head></head> <body class="article subpage ltr preset1 menu-طراحی-سایت-ریسپانسیو responsive bg hfeed clearfix"> <div class="body-innerwrapper"> <!-- [if lt IE 8]> <div class="chromeframe aler… --> <section id="sp-toolbar-wrapper" class=" hidden-phone"></section> <header id="sp-header-wrapper" class=""> <div class="container"> <div id="header" class="row-fluid"> <div id="sp-logo" class="span3"></div> <div id="sp-menu" class="span9"> <div id="sp-main-menu" class="visible-desktop"> <ul class="sp-menu level-0"> <li class="menu-item first parent "></li> <li class="menu-item parent "></li> <li class="menu-item active parent "> <a class="menu-item active parent " href="#"></a> <div class="sp-submenu sub-level" style="top: 40px; left: 0px;"> <div class="sp-submenu-wrap" style="margin-top: 0px; margin-left: 0px;"> <div class="sp-submenu-inner clearfix" style="width: 200px;"> <div class="megacol col1 first" style="width: 200px;"> <ul class="sp-menu level-1"> <li class="menu-item active first parent "> <a class="menu-item active first parent "></a> <div class="sp-submenu sub-level-child" style="top: 0px; left: 200px;"> <div class="sp-submenu-wrap" style="margin-top: 0px; margin-left: 0px;"></div> </div> </li> </ul> </div> </div> </div> </div> </li> <li class="menu-item parent "></li> <li class="menu-item"></li> <li class="menu-item parent "></li> <li class="menu-item last parent "></li> </ul> </div> </div> </div> </div> </header> <section id="sp-main-body-wrapper" class=" "></section> <section id="sp-bottom-2-wrapper" class=" "></section> <footer id="sp-footer-wrapper" class=" "></footer> <a class="hidden-desktop btn btn-inverse sp-main-menu-toggler" data-target=".nav-collapse" data-toggle="collapse" href="#"></a> <div class="hidden-desktop sp-mobile-menu nav-collapse collapse"></div> </div> <div class="rokbox-wrapper" data-rokboxwrapper="true"></div> <div class="uk-tooltip"></div> <div class="uk-tooltip"></div> </body> </html>