Du bist nicht angemeldet. Der Zugriff auf einige Boards wurde daher deaktiviert.
Seiten: 1
#1 19. August 2012 09:18
- Beppo
- hat von CMS/ms gehört
- Ort: Freiberg
- Registriert: 17. August 2012
- Beiträge: 8
[GELÖST] HEAD-bereich fixieren in "CSSMenu top + 2 columns" template
Hallo,
ich habe gerade CMSms neu in den Fingern und soweit komm ich gut klar, bis auf das fixieren des Head-bereiches im CSSMenu top + 2 columns tamplate.
Ich habe kein probs das menu zu fixieren, nur den ganzen HEAD-bereich möchte ich dauerhaft auf der site sehen.
Also alles bis unter die breadcrumbs und search.
Die frage ist nur WIE !!!
Wahrscheinlich recht einfach, nur bin ich nich so der crack & würde mich über etwas hilfe freuen
Ein DANKE vorab Beppo
Ps. is mein erster post in irgendeinem forum, war sonst nur leser
Beitrag geändert von Beppo (19. August 2012 09:20)
Offline
#2 19. August 2012 14:51
- Klenkes
- Server-Pate
- Ort: 89428 Syrgenstein
- Registriert: 17. Dezember 2010
- Beiträge: 1.437
Re: [GELÖST] HEAD-bereich fixieren in "CSSMenu top + 2 columns" template
Ich muss zugeben, dass ich nicht so genau verstehe, was du mit FIXIEREN meinst. Kannst du das näher erläutern?
Offline
#3 19. August 2012 15:28
- Janl
- Server-Pate
- Ort: Freistadt, Österreich
- Registriert: 13. Dezember 2010
- Beiträge: 1.231
- Webseite
Re: [GELÖST] HEAD-bereich fixieren in "CSSMenu top + 2 columns" template
Ich glaube du suchst [position:fixed;]
http://www.w3schools.com/css/css_positioning.asp
schau es mal da nach.
mfg
Jan
Kubuntu 22.04 - Win 11 pro / Kubuntu 20.04 - win10 pro
Offline
#4 20. August 2012 22:13
- Beppo
- hat von CMS/ms gehört
- Ort: Freiberg
- Registriert: 17. August 2012
- Beiträge: 8
Re: [GELÖST] HEAD-bereich fixieren in "CSSMenu top + 2 columns" template
Heißen Dank erstmal
Ich möchte das der HEAD-bereich aus:
Logo site title
menu menu menu menu menu menu menu menu menu menu
breacrumbs search button
Auf der site immer zu sehen ist, damit die Besucher nicht erst wieder hoch scrollen müssen.
Während content und sidebars (news, 2. navi, etc) gescrollt werden.
Auf einer html-site hätte ich ein iframe benutzt in dem der content etc untergebracht wäre.
Und über das menu würde jede neue site im iframe erscheinen.
Der Head-bereich wäre dann immer sichtbar.
Nur wie geht das in CMSms hyacinth ????
Übrigens http://www.w3schools.com/css/css_positioning.asp ist echt super DANKE Janl
Offline
#5 20. August 2012 04:43
- nockenfell
- Moderator
- Ort: Gontenschwil, Schweiz
- Registriert: 09. November 2010
- Beiträge: 2.934
- Webseite
Re: [GELÖST] HEAD-bereich fixieren in "CSSMenu top + 2 columns" template
Schau dir mal folgende Webseite an:
http://www.klein-abend.ch/gallery/Bilde … nne/57.htm
Hier ist das (mit einem anderen Design) so gelöst. Die Webseite ist fix, während man den Inhalt scrollen kann:
div#contentscroll {
padding-left : 30px;
/*padding-top : 37px;*/
padding-right : 0px;
/*padding-bottom : 10px;*/
height : 477px;
width : 690px;
overflow: auto;
font-size : 1em;
background : #fff;
color : #010000;
}
[dieser Beitrag wurde mit 100% recycled bits geschrieben]
Mein Blog / Diverse Links rund um CMS Made Simple
Module: btAdminer, ToolBox
Offline
#6 20. August 2012 09:30
- otter24
- kennt CMS/ms
- Ort: Hamburg
- Registriert: 12. Januar 2011
- Beiträge: 339
Re: [GELÖST] HEAD-bereich fixieren in "CSSMenu top + 2 columns" template
Du willst den Header oben am Browser Fenster fixieren. Durchforste mal das Web nach "Sticky Header"
hier ist ein Beispiel
Ich bin war kein Klugscheißer, ich weiß wusste es wirklich nicht besser.
Offline
#7 25. August 2012 15:45
- Beppo
- hat von CMS/ms gehört
- Ort: Freiberg
- Registriert: 17. August 2012
- Beiträge: 8
Re: [GELÖST] HEAD-bereich fixieren in "CSSMenu top + 2 columns" template
Hallo zusammen!
Das Thema ist geklärt und zwar mit dem " STICKY HEADER " wie otter24 es vorschlug.
Allerdings gibt es einen kleinen Wermutstropfen, nämlich das der searchbutton etwas nach unten gerutscht ist und ich ihn nicht wieder an seinen alten Platz bekomme.
So sieht das dann aus http://www.caverna-magica.de/STICKY_HEA … sition.png
Und hier ist der code der template-site:
HTML
{process_pagedata}<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> {* Change lang="en" to the language of your site *} {* note: anything inside these are smarty comments, they will not show up in the page source *} <head> <title>{sitename} - {title}</title> {* The sitename is changed in Site Admin/Global settings. {title} is the name of each page *} {metadata} {* Don't remove this! Metadata is entered in Site Admin/Global settings. *} {cms_stylesheet} {* This is how all the stylesheets attached to this template are linked to it *} {cms_selflink dir="start" rellink=1} {cms_selflink dir="prev" rellink=1} {cms_selflink dir="next" rellink=1} {* Relational links for interconnections between pages, good for accessibility and Search Engine Optimization *} {* the literal below and the /literal at the end are needed whenever there are {"curly brackets"} as smarty will think it's something to process and will throw an error *} {literal} <script type="text/JavaScript"> <!-- //pass min and max - measured against window width function P7_MinMaxW(a,b){ var nw="auto",w=document.documentElement.clientWidth; if(w>=b){nw=b+"px";}if(w<=a){nw=a+"px";}return nw; } //--> </script> <!--[if lte IE 6]> <style type="text/css"> #pagewrapper {width:expression(P7_MinMaxW(720,950));} #container {height: 1%;} </style> <![endif]--> {/literal} {* The min and max page width for Internet Explorer is set here. For other browsers it's in the stylesheet "Layout: Top menu + 2 columns" *} <!--[if lte IE 6]> <script type="text/javascript" src="modules/MenuManager/CSSMenu.js"></script> <![endif]--> {* The above JavaScript is required for CSSMenu to work in IE *} </head> <body> <div id="pagewrapper"> {* start accessibility skip links, anything with the class of accessibility is hidden with CSS from visual browsers *} <ul class="accessibility"> <li>{anchor anchor='menu_vert' title='Skip to navigation' accesskey='n' text='Skip to navigation'}</li> <li>{anchor anchor='main' title='Skip to content' accesskey='s' text='Skip to content'}</li> </ul> {* end accessibility skip links *} <hr class="accessibility" /> {* Horizontal ruler that is hidden for visual browsers by CSS *} {* Start Header, with logo image that links to the default start page. Logo image is changed in the stylesheet "Layout: Top menu + 2 columns" *} <!----------------------------------------- BEGIN: Sticky Header -------------------------------------------> <div id="header_container"> <div id="header"> {* this holds the name of the site on the right side *} <h2 class="headright">{sitename}</h2> {* a link back to home page and the header left image/logo, text is hidden using CSS *} <h1>{cms_selflink dir="start" text="$sitename"}</h1> <hr class="accessibility" /> </div> {* End Header *} {* Start Navigation *} <div id="menu_vert"> {* stylesheet "Navigation: CSSMenu - Horizontal" *} <h2 class="accessibility">Navigation</h2> {menu loadprops=0 template='cssmenu.tpl'} <hr class="accessibility" /> </div> {* End Navigation *} {* Start Search, the input "Submit" is using an image, CSS: input.search-button *} <div id="search"> {search} </div> {* End Search *} {* Start Breadcrumbs *} <div class="crbk"> {* holds the right image, we need 2 divs to be able to make this site fluid, if it was fixed width we could use one div, one image *} <div class="breadcrumbs"> {breadcrumbs starttext='You are here' root='Home' delimiter='»'} <hr class="accessibility" /> </div> </div> {* End Breadcrumbs *} </div> <!---------------------------------- END: Sticky Header ----------------------------------------------------> <!---------------------------------- BEGIN PAGE FROM: Content to Footer---------------------------------> <div id="container"> {* Start Content *} <div id="content"> {* Start Sidebar *} <div id="sidebar"> <div id="sidebarb"> {content block='Sidebar'} {* Start News, stylesheet "Module: News" *} <div id="news"> <h2>News</h2> {news number='3' detailpage='news'} </div> {* End News *} </div> </div> {* End Sidebar *} {* Start Content Area, the back1, back2, back3, hold the 3 outside images, main holds the 4th one, to make the box complete, if the template were fixed width not fluid we could use just 2 divs and 2 images, 1 top 1 bottom *} <div class="back1"> <div class="back2"> <div class="back3"> <div id="main"> <div style="float: right;">{print showbutton=true script=true}</div> <h2>{title}</h2> {content} <br />{* to insure space below content *} {* Start relational links *} {* note this is the right side, when you float: divs you need to have float: right; divs first *} <div class="right49"> <p>{anchor anchor='main' text='^ Top'}</p> </div> <div class="left49"> <p> {cms_selflink dir="previous" label="Previous page: "} {* The label parameter doesn't need to be there if you're using English, but is here to show how it's used if you don't want the English text "Previous page" *} <br /> {cms_selflink dir="next"} </p> </div> {* End relational links *} <hr class="accessibility" /> <div class="clear"></div> </div> </div> </div> </div> {* End Content Area *} </div> {* End Content *} {* Start Footer. Edit the footer in the Global Content Block called "footer" *} <div class="footback"> <div id="footer"> {* stylesheet "Navigation: FatFootMenu" *} <div id="fooleft"> {menu loadprops=0} </div> <div id="footrt"> {global_content name='footer'} </div> <div class="clear"></div> </div> </div> {* End Footer *} </div> {* end pagewrapper *} </div> <!-- END PAGE FROM: Content to Footer --> </body> </html>
Und hier ist der code des stylesheet:
CSS
/* browsers interpret margin and padding a little differently, we'll remove all default padding and margins and set them later on */ * { margin: 0; padding: 0; } /*Set initial font styles*/ body { text-align: left; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 75.01%; line-height: 1em; } /*set font size for all divs, this overrides some body rules*/ div { font-size: 1em; } /*if img is inside "a" it would have borders, we don't want that*/ img { border: 0; } /*default link styles*/ /* set all links to have underline and bluish color */ a, a:link a:active { text-decoration: underline; /* css validation will give a warning if color is set without background color. this will explicitly tell this element to inherit bg colour from parent element */ background-color: inherit; color: #18507C; } a:visited { text-decoration: underline; background-color: inherit; color: #18507C; /* a different color can be used for visited links */ } /* remove underline on hover and change color */ a:hover { text-decoration: none; background-color: inherit; color: #385C72; } /*****************basic layout *****************/ body { margin: 0; padding: 0; /* default text color for entire site*/ color: #333; /* you can set your own image and background color here */ background: #f4f4f4 url([[root_url]]/uploads/ngrey/body.png) repeat-x left top; } div#pagewrapper { /* min max width, IE wont understand these, so we will use java script magic in the <head> */ max-width: 99em; min-width: 60em; /* now that width is set this centers wrapper */ margin: 0 auto; background-color: #fefefe; color: black; } /* --------------MAKE HEADER STICKY------------------------------------------------------------- THIS DIV#HEADER_CONTAINER SET THE PROPERTIES FOR THE STICKY AREA--------------------------------- */ div#header_container { background:#eee; border:1px solid #666; height:60px; left:0; position:fixed; width:100%; top:0; } /*#header{ line-height:60px; margin:0 auto; width:940px; text-align:center; }*/ /* header, we will hide h1 a text and replace it with an image, we assign a height for it so the image wont cut off */ div#header { /* adjust according your image size */ height: 100px; margin: 0; padding: 0; /* you can set your own image here, will go behind h1 a image */ background: #f4f4f4 url([[root_url]]/uploads/ngrey/bg_banner.png) repeat-x left top; /* border just the bottom */ border-bottom: 1px solid #D9E2E6; } div#header h1 a { /* you can set your own image here */ background: url([[root_url]]/uploads/ngrey/logoCMS.png) no-repeat left top; /* this will make the "a" link a solid shape */ display: block; /* adjust according your image size */ height: 100px; /* this hides the text */ text-indent: -999em; /* old firefox would have shown underline for the link, this explicitly hides it */ text-decoration: none; } div#header h1 { margin: 0; padding: 0; /*these keep IE6 from pushing the header to more than the set size*/ line-height: 0; font-size: 0; /* this will keep IE6 from flickering on hover */ background: url([[root_url]]/uploads/ngrey/logoCMS.png) no-repeat left top; } div#header h2 { /* this is where the site name is */ float: right; line-height: 1.2em; /* this keeps IE6 from not showing the whole text */ font-size: 1.5em; /* keeps the size uniform */ margin: 35px 65px 0px 0px; /* adjust according your text size */ color: #f4f4f4; } div.crbk { /* sets all to 0 */ margin: 0; padding: 0; /* you can set your own image here */ background: url([[root_url]]/uploads/ngrey/mainrtup.gif) no-repeat right bottom; } div.breadcrumbs { /* CSS short hand rule first value is top then right, bottom and left */ padding: 1em 0em 1em 1em; /* its good to set font sizes to be relative, this way viewer can change his/her font size */ font-size: 90%; /* css shorthand rule will be opened to be "0px 0px 0px 0px" */ margin: 0px; /* you can set your own image here */ background: url([[root_url]]/uploads/ngrey/mainleftup.gif) no-repeat left bottom; } div.breadcrumbs span.lastitem { font-weight: bold; } div#search { /* position for the search box */ float: right; /* enough width for the search input box */ width: 27em; text-align: right; padding: 0.5em 0 0.2em 0; margin: 0 1em; } /* a class for Submit button for the search input box */ input.search-button { border: none; height: 22px; width: 53px; margin-left: 5px; padding: 0px 2px 2px 0px; /* makes the hover cursor show, you can set your own cursor here */ cursor: pointer; /* you can set your own image here */ background: url([[root_url]]/uploads/ngrey/search.gif) no-repeat center center; } /* CSS for the content of page. I am giving top and bottom padding of 80px to make sure the header and footer do not overlap the content.*/ div#container { margin:0 auto; overflow:auto; padding:175px 0; width:940px; } /*div#content{}*/ div#content { /* some air above and under menu and content */ margin: 1.5em auto 2em 0; padding: 0px; } /* this gets all the outside calls that were used on the div#main before */ div.back1 { /* this will give room for sidebar to be on the left side, make sure this number is bigger than sidebar width */ margin-left: 29%; /* and some air on the right */ margin-right: 2%; /* you can set your own image here */ background: url([[root_url]]/uploads/ngrey/mainrt1.gif) no-repeat right top; } /* this is an IE6 hack, you may see these through out the CSS */ * html div.back1 { /* unlike other browser IE6 needs float:right and a width */ float: right; width: 69%; /* and we take this out or it will stop at the bottom */ margin-left: 0%; /* and some air on the right */ margin-right: 10px; /* you can set your own image here */ background: url([[root_url]]/uploads/ngrey/mainrt1.gif) no-repeat right top; } div.back2 { /* you can set your own image here */ background: url([[root_url]]/uploads/ngrey/mainleft1.gif) no-repeat left top; } div.back3 { /* you can set your own image here */ background: url([[root_url]]/uploads/ngrey/wbtmleft.gif) no-repeat left bottom; } div#main { /* this is the last inside div so we set the space inside it to keep all content away from the edges of images/box */ padding: 10px 15px; /* you can set your own image here */ background: url([[root_url]]/uploads/ngrey/rtup.gif) no-repeat right bottom; } div#sidebar { /* set sidebar left. Change to right, float: right; instead, but you will need to change the margins. */ float: left; /* sidebar width, if you change this change div.back and/or div.back1 margins */ width: 26%; /* FIX IE double margin bug */ display: inline; /* the 20px is on the bottom, insures space above footer if longer than content */ margin: 0px 0px 20px; padding: 0px; /* you can set your own image here */ background: url([[root_url]]/uploads/ngrey/mainrt.gif) no-repeat right top; } div#sidebarb { padding: 10px 15px 10px 20px; /* this one is for sidebar with content and no menu */ background: url([[root_url]]/uploads/ngrey/mainrtup.gif) no-repeat right bottom; } div#sidebarb div#news { /* less margin surrounding the news, sidebarb has enough */ margin: 2em 0 1em 0em; } div#sidebara { padding: 10px 15px 15px 0px; /* this one is for sidebar with menu and no content */ background: url([[root_url]]/uploads/ngrey/mainrtup.gif) no-repeat right bottom; } div.footback { /* keep footer below content and menu */ clear: both; /* this sets 10px on right to let the right image show, the balance 10px left on next div */ padding: 0px 10px 0px 0px; /* you can set your own image here */ background: url([[root_url]]/uploads/ngrey/wfootrt.gif) no-repeat right top; } div#footer { /* this sets 10px on left to balance 10px right on last div */ padding: 0px 0px 0px 10px; /* color of text, the link color is set below */ color: #595959; /* you can set your own image here */ background: url([[root_url]]/uploads/ngrey/wtopleft.gif) no-repeat left top; } div.leftfoot { float: left; width: 30%; margin-left: 20px } div#footer p { /* sets different font size from default */ font-size: 0.8em; /* some air for footer */ padding: 1.5em; /* centered text */ text-align: center; margin: 0; } div#footer p a { /* footer link would be same color as default we want it same as footer text */ color: #595959; } /* as we hid all hr for accessibility we create new hr with div class="hr" element */ div.hr { height: 1px; padding: 1em; border-bottom: 1px dotted black; margin: 1em; } /* relational links under content */ div.left49 { /* combined percentages of left+right equaling 100% might lead to rounding error on some browser */ width: 70%; } div.right49 { float: right; width: 29%; /* set right to keep text on right */ text-align: right; } /********************CONTENT STYLING*********************/ /* HEADINGS */ div#content h1 { /* font size for h1 */ font-size: 2em; line-height: 1em; margin: 0; } div#content h2 { color: #294B5F; /* font size for h2 the higher the h number the smaller the font size, most times */ font-size: 1.5em; text-align: left; /* some air around the text */ padding-left: 0.5em; padding-bottom: 1px; /* set borders around header */ border-bottom: 1px solid #899092; border-left: 1.1em solid #899092; /* a larder than h1 line height */ line-height: 1.5em; /* and some air under the border */ margin: 0 0 0.5em 0; } div#content h3 { color: #294B5F; font-size: 1.3em; line-height: 1.3em; margin: 0 0 0.5em 0; } div#content h4 { color: #294B5F; font-size: 1.2em; line-height: 1.3em; margin: 0 0 0.25em 0; } div#content h5 { color: #294B5F; font-size: 1.1em; line-height: 1.3em; margin: 0 0 0.25em 0; } h6 { color: #294B5F; font-size: 1em; line-height: 1.3em; margin: 0 0 0.25em 0; } /* END HEADINGS */ /* TEXT */ p { /* default p font size, this is set different in some other divs */ font-size: 1em; /* some air around p elements */ margin: 0 0 1.5em 0; line-height: 1.4em; padding: 0; } blockquote { border-left: 10px solid #ddd; margin-left: 10px; } strong, b { /* explicit setting for these */ font-weight: bold; } em, i { /* explicit setting for these */ font-style: italic; } /* Wrapping text in <code> tags. Makes CSS not validate */ code, pre { /* css-3 */ white-space: pre-wrap; /* Mozilla, since 1999 */ white-space: -moz-pre-wrap; /* Opera 4-6 */ white-space: -pre-wrap; /* Opera 7 */ white-space: -o-pre-wrap; /* Internet Explorer 5.5+ */ word-wrap: break-word; font-family: "Courier New", Courier, monospace; font-size: 1em; } pre { /* black border for pre blocks */ border: 1px solid #000; /* set different from surroundings to stand out */ background-color: #ddd; margin: 0 1em 1em 1em; padding: 0.5em; line-height: 1.5em; font-size: 90%; } /* Separating the divs on the template explanation page */ div.templatecode { margin: 0 0 2.5em; } /* END TEXT */ /* LISTS */ /* lists in content need some margins to look nice */ div#main ul, div#main ol, div#main dl { font-size: 1.0em; line-height: 1.4em; margin: 0 0 1.5em 0; } div#main ul li, div#main ol li { margin: 0 0 0.25em 3em; } /* definition lists topics on bold */ div#main dl { margin-bottom: 2em; padding-bottom: 1em; border-bottom: 1px solid #c0c0c0; } div#main dl dt { font-weight: bold; margin: 0 0 0 1em; } div#main dl dd { margin: 0 0 1em 1em; } /* END LISTS */
Offline
#8 26. August 2012 00:34
- mike-r
- arbeitet mit CMS/ms
- Registriert: 21. Dezember 2010
- Beiträge: 898
- Webseite
Re: [GELÖST] HEAD-bereich fixieren in "CSSMenu top + 2 columns" template
da ist sehr wahrscheinlich ein clear nicht korrekt gesetzt, oder irgendeine Breite/ Höhe falsch vergeben.
Hol Dir mal Firebug, dann siehst Du am besten und schnellsten, was das Element da runterdrückt.
Edit: Tidy ist auch keine schlechte Idee ... siehe Signatur
Beitrag geändert von mike-r (26. August 2012 00:35)
Unablässige Tools für's Webdevelopement/ Fehlerfindung: CSS Validierungsservice, Bildschirmlineal, Firebug, Tidy, Deutsche CSS-Referenz
Offline
#9 26. August 2012 08:05
- Beppo
- hat von CMS/ms gehört
- Ort: Freiberg
- Registriert: 17. August 2012
- Beiträge: 8
Re: [GELÖST] HEAD-bereich fixieren in "CSSMenu top + 2 columns" template
Das template ist fertig und funktioniert !!!
@mike-r : Der button ist wieder da wo er hingehört. Ich habe einfach das label " Suche " entfernt!
<label for="cntnt01searchinput"><Suche/label>
Da sowie so im Eingabefeld " Suche/search " drin steht und auf dem button, und ALLE wissen daß das die Suche ist, braucht auch keiner noch ein zusätzliches label ( ODER ? )
Jetzt ist genug Platz für den button dahinter, auch bei Größenänderungen ( strg + +/- ) !!!
DIESES THEMA IST GELÖST !!!!!!!!!
DANKE an alle die halfen
Ich werde das fertige Layout im SHOW OFF posten & ein kleines TUT machen wie man easy etwas "sticky" macht.
DANKE Beppo
Beitrag geändert von Beppo (26. August 2012 08:23)
Offline
Seiten: 1