Is there a way to do this?
When using navigation that can change the number of items often, it would be nice not having to calculate the with and updating the css, but just having a solution that works.
if that's impossible (I'm assuming it is) can anyone point me to a javascript that can do this?
edit
re: provide code some code
basically I'm working with, what I think is, the most typical setup
<div class="main">
<div class="nav">
<ul>
<li>short title</li>
<li>Item 3 Long title</li>
<li>Item 4 Long title</li>
<li>Item 5 Long title</li>
<li>Item 6 Extra Long title</li>
</ul>
</div>
</div>
edit
.main {
width:100%;
text-align:center;
}
.nav {
margin:0 auto;
}
.nav ul li {
display:inline;
text-align:left;
}
the issue I've found with this/these solutions is that the content is nudged to the right
adding some right padding (of 40px) seems to fix this across the browsers I'm checking on (O FF IE).
.nav {
margin:0 auto;
padding-right:40px;
}
I don't know where this value is coming from though and why 40px fixes this.
Does anyone know where this is coming from? it's not a margin or padding but no matter what I do the first about 40px can not be used for placement.
Maybe it's the ul or li that's adding this.
I've had a look at the display:table-cell way of doing this, but there's that complication with IE and it still has the same issue as the other solution
edit (final)
okay I've tried some things in regard to the indent.
I've reset all padding to 0
*{padding:0;}
that fixed it, and I don't need to offset the padding
(I think I'll leave my whole process up so if anyone comes across this, it'll save them some time)
thanks for the comments and replies
I wish to know if there is a good way to do a bulk delete or delete multiple rows using the Entities Framework 4. I can't seam to find a DeleteAll command. The only one that is available is DeleteObject() which only takes one entity, I would like to perform a delete on a list of entities.Is there a better way than to loop trough the list? I did see an article that used ExecuteStoreQuery and created some sql that would perform the delete. Is there a better way than to perform any of these two options Please advice what is the best way to perform this action.
I'm working on a website for a small law office. In the side-menu, I'm trying to highlight the "current page". I have tried changing the background of the LI, but this doesn't quite do the trick; the list item doesn't spread to the full width of the menu, so it looks bad.
Here's a jfiddle. I would like the yellow section to highlight like the pink section is highlighted: filling up the full vertical and horizontal space, not just highlighting the text.
Any suggestions on how to do this? I've included the style tag in the html just for example, obviously, and my real solution will be a little different when it's done. But I can't move forward until I figure out how to somehow highlight the entire line.
For testing
I don't want to upload css to FTP on each change till site complete , but site and content is online. (i'm not talking about saving page locally then apply css)
Can i just apply css locally to any online page.
it would be easier to edit and see changes locally till css work end.
and i want to see applied effect on FF and IE.
How to do that? Is it possible.
I have a div that is 200px by 200px.
If I want to place a 30x30px no-repeat background image at the top left corner position of 120px from the left and 50px from the top ... while also allowing the text inside that div to be displayed on top of the background image ... how would I do that?
I tried the following, but it doesnt appear to work.
background:url(http://example.com/background-image.png) no-repeat 120px 50px;
Any ideas how to perform what I want to accomplish?
Hi,
i have this page.
login: [email protected]
password: m
As you can see in IE7 the selects for the age, and radio buttons are not well organized. In FF and IE8 no problem.
Any idea?
Regards
Javi
hi. i used this corner style:
.corners4{
background:url(../img/panelHeaderColor.jpg) repeat-x;
-moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px;
-moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px;
-moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px;
-moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px;
}
but, this doesn't work in IE, is there any IE equivalent for this?
thanks
Not sure why I am having such a hard time with this. Trying to add a 10px top margin to a that is inside of a div. But that does not add the gutter I want and just pushes the containing div down 10px.
Styles
#item{width:738px; height:168px; background-image:url(../images/item_bg.png);margin:0px auto;}
#description{width:314px; height:55px;}
#description p{font:12px arial; color:#666666;margin:10px 0 0 30px;}
HTML/PHP
echo "<div id='item'>
<div id='description'><p>{$row['description']}</p></div>
</div>";
If I use padding it works fine but I want to know why margin-top isn't working?
Does anyone have a technique to automap (using Automapper) references to child entities. So say I have a ViewModel:
class AddressModel
{
int Id;
string Street;
StateModel State;
}
class StateModel
{
int Id;
string Name;
}
And I pass this into a repository to map to equivalent entities in Entity Framework. When Automapping, I want it to automap AddressModel.State.ID to the EntityKey of AddressEntity.StateReference. So hand crafted code would look like this:
addressEntity.Id = AddressModel.Id;
addressEntity.Street = AddressModel.Street
addressEntity.StateReference.EntityKey = new EntityKey("MyDB.States", "Id", AddressModel.State.Id);
Obviously, when automapper tries to assign an Address.State.Id to the equivalent in EF, an exception is thrown.
I have to show 25% right screen in such way that the text looks appeared from right. For this I need to set opacity from 0 to 100 at 25% right side screen means rightmost opacity would be 0 and at 75% the opacity would be 100.
For this, I took a Div and set opacity but It looks bad because of border. I need to gray out text. It looks a block.
Let me know how I can implement cross browser compatible gradient opacity mask for right screen text.
What is the best way to do this?
I need some help with the positioning of divs that appear on each #box's hover event.
The hidden divs should appear over the box that was hovered in a way that:
Each #tooltip div covers the box that was hovered plus the box next to it
The tooltips of boxes 1 & 2 should cover the boxes to the right
#tooltips for box 3 & 4 should cover the boxes to their left
(to make it more understandable, please see the attached image
There will be several rows of boxes so positioning should be relative and not fixed to the page dimensions (i suppose)
So far I haven't managed to get the #tooltip positionings right (I know that one should be absolute and the other relative but no matter my efforts, I haven't nailed it yet).
Here's a jsfiddle to work on and this is the result i'm after:
Hi everybody,
I'm trying to make four columns that are centered on the frontpage. I would like it to look like this example:
http://www.clutterpad.com/
My code looks like this:
#bottom-container {width:100%;height:250px;position:relative;}
#bottom-mid {background-color:white;}
#bottom-left, #bottom-mid, #bottom-right {height:250px;}
#bottom-left, #bottom-right {width:50%;float:left;}
#bottom-left {background-color:white;position:absolute;top:0px;left:0px;}
#bottom-right {background-color:white;position:absolute;top:0px;left:50%;}
#bottom-mid {position:relative;margin:0px auto; width:1000px;z-index:2;}
#column-container {width:100%; margin:20px auto;}
.column {width:200px;float:left;font-size:10pt;font-family:Arial;margin:20px 10px;}
But it's not working out. How should I code it to look like the example I mentioned before?
I am getting familiar with Zend Framework (and MVC with PHP in general) for a personal project. I have previous experience with Smarty and have no major gripes with it, but I would like to use this project as a good in-depth learning exercise. Those of you familiar with different templating engines and ZF: Do you believe there are better templating engines than Smarty in conjunction with ZF and why? I would like to apply what I learn to the real world and production environments.
The personal project will be fairly robust. User management, sessions, security, database interaction, form input, jQuery, etc.
The problem I am having is that for some reason ShowDialog returns immediately after handle an exception. However, it works for MessageBox.Show() or at the second time I call ShowDialog. What is the best workaround for this problem?
I was only able to find this. And I cannot believe that no one else has this issue.
I am using .net compact framework 3.5. Sample code:
try
{
using(SomeForm f = new SomeForm())
{
f.ShowDialog();
}
}
catch(SomeException)
{
using(SomeOtherForm f = new SomeOtherForm())
{
f.ShowDialog(); // this returns immediately
// if this is MessageBox.Show(), it works correctly.
f.ShowDialog(); // then this works fine
}
}
So far I know, the conditional comments are only supported for different Versions of IE.
Likeways, can we provide conditional comments for other browsers too.
If Yes, How? If no, what could be the best alternative?
How can I have each of these a elements break on to new lines, but keeping them as display=inline and without br tags?
<div>
<a href="element1">Element 1</a>
<a href="element1">Element 2</a>
<a href="element1">Element 3</a>
</div>
I'm building a community website (not WoW related) and am curious what, if any, framework(s) Wowhead may use. The general, non-WoW specific functions of the site are near identical to what I need.
A few of the features I'm interested in are:
Item page comments
User/Account management
Forums
Blog
Content Management
Search box suggestion
I'm sure allot of their site is custom built but I assume that some portions may be third-party solutions, like the forums and blog.
I just don't want to reinvent the wheel if it's out there ready for me to make use of.
please give me the code.
input file:
#box8 {
position:absolute;
}
#box8 .buttons {
text-align:left;
}
output file should be like this:
headers:#box8
#box8
Items:position:absolute;
text-align:left;
i have this
<li><a href="#" >title</a> <span style='text-align:right;'>(0)</span></li>
its not working
and this
<li><a href="#" >title</a> <span style='float:right;'>(0)</span></li>
its go to the down line (not working)
its appear like that
|title (0) |
i want it
|title (0)|
I'm just starting out with Zend Framework and am having issues using Zend_Controller_Action_HelperBroker::addPath() to add helpers. I'm not sure if my classes are named incorrectly, I'm giving it the wrong prefix, or what I'm doing wrong so I will post the code and file structure and get out of the way.
In Bootstrap.php
public function __construct($application)
{
...
// This works with a manual include_once('../application/plugins/helpers/Csrf.php');
//Zend_Controller_Action_HelperBroker::addHelper(new Application_Controller_Action_Helper_Csrf());
// This isn't picking up my helper class automagically
Zend_Controller_Action_HelperBroker::addPath('../application/plugins/helpers','Application_Controller_Action_Helper');
...
}
In application/plugins/helpers/Csrf.php
class Application_Controller_Action_Helper_Csrf extends Zend_Controller_Action_Helper_Abstract
{
...
}
My directory tree:
/
application/
...
plugins/
helpers/
Csrf.php
CsrfProtect.php
...
what I want:
when i hover upon a link it should fill the background with a fixed width (say 225px) background color.
the length of the text of the link should not be considered.
thank you so much.
Hi All,
i need an equivalent or an alternative for this code in internet explorer using the filter method
background: -moz-linear-gradient(center bottom , rgb(132, 133, 132) 0%, rgb(35, 35, 35) 49%, rgb(104, 104, 104) 100%) repeat scroll 0% 0% transparent;
the most important thing in the code is the points ( 0% - 49% - 100% )
i believe that the filter method doesn't have points and doesn't accpect more than two parms for the colors ,
Is there a way to do it in filter or a javascript script for that ?
Thanks.
I'm using Entity Framework 4.1 with a Code-First approach on an ASP.NET MVC site
Say I have an entity named Profile that keeps track of a user's favorite book, and I want to track when the user updates their favorite book.
UPDATED:
Using the class below as an example, I want to set the FavoriteBookLastUpdated property to the current date whenever the value of the FavoriteBook property changes.
public class Profile
{
public int Id { get; set; }
public string Name { get; set; }
public string FavoriteBook { get; set; }
public DateTime? FavoriteBookLastUpdated { get; set; }
}
Right now I just update that field, if appropriate, in the controller's Edit action before calling the DBContext's SaveChanges() method.
Is there a way I can put that logic in my model somehow? I'd prefer not to use triggers on the database side.
Lets say i have a Person table, a Role table with a trel table PersonRoles linking them as many to many.
I create a new person and assign them to 2 roles (role 1, role 3).
I then want to edit this person; so i retrieve their data and bind their roles to a checkboxes. I change the values (Deselect role 1 and select role 2 instead) I then post this data back through a viewmodel.
Can i then get Entity Framework to update these roles for me, as in delete the entry in PersonRoles to role 1 and then add a new entry as role 2? Or do i have to do the logic for this myself?
Cheers,
Kohan